Let $Z:(\Omega,\mathcal F)\to(E,\mathcal E)$ be a random variable taking values in a standard Borel space, and let $Y:(\Omega,\mathcal F)\to(\mathbb R,\mathcal B(\mathbb R))$ be a $\sigma(Z)$-measurable random variable. Then there exists a measurable function $g:E\to\mathbb R$ such that
\begin{align*}
Y=g(Z)
\end{align*}
$\mathbb P$-a.e.