Measurability of one Random Variable with respect to Another

After several hours of struggling, I've been unable to solve the following problem

Let $X,Y: (\Omega, \mathcal{S}) \rightarrow (\mathbb{R}, \mathcal{R})$ where $\mathcal{R}$ are the Borel Sets for the Reals. Show that $Y$ is measurable with respect to $\sigma(X) = \{ X^{-1}(B) : B \in \mathcal{R} \}$ if and only if there exists a function $f: \mathbb{R} \rightarrow \mathbb{R}$ such that $Y(\omega) = f(X(\omega))$ for all $\omega \in \Omega$.

Firstly, I am assuming that for $Y$ to be measurable with respect to $\sigma(X)$ means that $\forall B \in \mathcal{R} \quad Y^{-1}(B) \in \sigma(X)$. The text (Probability: Theory and Examples) failed to define the phrase.

The problem following it begins describing a constructive proof where we split $Y$'s range into segments of increasingly fine granularity ( i.e. $\left [\frac{m}{2^{n}}, \frac{m+1}{2^{n}}\right)$ for each $m \in \mathbb{N}$ ) and define a function between $X$'s range and $Y$'s for each level of granularity ( i.e. by noting that $Y^{-1}\left(\left[\frac{m}{2^{n}}, \frac{m+1}{2^{n}}\right)\right)$ = $X^{-1}(B_{n,m})$ for some $B_{n,m} \in \mathcal{R}$ and defining $f_{n}(x) = \frac{m}{2^{n}}$ when $x \in B_{n,m}$ ), then need to show that $Y$ is equal to this function in the limit.

Unfortunately I can't even make sense of how each of these functions are defined, much less use them. In particular, I don't see how each $x \in \mathbb{R}$ maps to a single $B_{n,m}$, which would mean we would need to define $f_{n}$ via the infimum of all available values. Take the example that $X(\omega) = 0$ for all $\omega$.

As this constructive proof is a separate problem, there must then exist a non-constructive one as well which is perhaps more concise. I have been unable to make any headway in that respect.


Here is my favorite proof.

You probably know the following fact:

If $(\Omega, \mathcal{F})$ is a measurable space and $Y : \Omega \to \mathbb{R}$ is a measurable function, then there exist measurable simple functions $Y_n : \Omega \to \mathbb{R}$ with $Y_n \to Y$ pointwise.

Recall that a simple function (or simple random variable) is one of the form $Z = \sum_{i=1}^m a_i 1_{A_i}$, where $A_i \in \mathcal{F}$.

Now apply this fact to the measurable space $(\Omega, \sigma(X))$. We get that $Y = \lim Y_n$, where $Y_n = \sum_{i=1}^{m_n} a_{i,n} 1_{A_{i,n}}$. But $A_{i,n} \in \sigma(X)$, which means $A_{i,n} = X^{-1}(B_{i,n})$ for some Borel sets $B_{i,n}$. So if we set $f_n = \sum a_{i,n} 1_{B_{i,n}}$, we actually have $Y_n = f_n(X)$.

We'd like to just say: let $f = \lim f_n$ and then $Y = f(X)$. There's a slight problem in that each $f_n$ could do something crazy with values that are not in the range of $X$, and they need not converge on those values. But there's a simple workaround: set $f = \limsup f_n$. Of course $f$ is measurable, and we have $f(X) = \limsup f_n(X) = \limsup Y_n = Y$.


An abstract approach works in the opposite direction.

Start with all bounded, measurable functions of $X$, that is, let ${\cal K}={\cal H}=\{f(X): f\in b{\mathcal{R}}\}$ where $b{\mathcal{R}}$ refers to all bounded, Borel-measurable $f: (\mathbb{R},\mathcal{R}) \rightarrow (\mathbb{R},\mathcal{R}).$

Clearly ${\cal K}$ is multiplicative, and ${\cal H}$ is a vector space that contains the constant function $1_\Omega$. To show that ${\cal H}$ is a monotone vector space, suppose $0\leq f_n(X)\uparrow Y\leq M$ for some constant $M$. Replace $f_n$ by $g_n:=(f_n)_+\wedge M$ and we still have $0\leq g_n(X)\uparrow Y\leq M$. Set $g=\limsup_n g_n$ so that $g\in b{\mathcal{R}}$ and $$Y(\omega)=\limsup_n\ g_n(X(\omega))=g(X(\omega)).$$

This shows that ${\cal H}$ is a monotone vector space so we can invoke the functional Monotone Class Theorem and conclude that ${\cal H}$ contains every bounded function measurable with respect to $\sigma({\cal K})=\sigma(X)$. That is, every bounded $Y$ that is measurable with respect to $\sigma(X)$ can be expressed as a measurable function of $X$.

It is now easy to extend this to non-bounded $Y$.