I've been reading through a math. stats. book, and I'm a little confused with the concept of measurable random variables. The book states:

> 
> Let $(E, \mathcal{E})$ and $(F,\mathcal{F})$ be two measurable spaces. A random variable $X : E → F$ is called measurable (relative to $\mathcal{E}$ and $\mathcal{F}$) if $X^{−1}(\Lambda) \in \mathcal{E}$ for all $\Lambda \in \mathcal{F}$.
> 
> 
> 

Now, here's my question: If it says "$X:(\Omega,\mathcal{A}) → (\mathbb{R}, \mathcal{B})$" without defining $\mathcal{B}$, then I can assume $\mathcal{B}$ is just the image of $X$, right? But, with this assumption, wouldn't all random variables be measurable? It seems like all random variables would be measurable, then, unless $\mathcal{B}$ was constructed in such a way that $X$ would not map onto $\mathcal{B}$. Is that true? Can anyone give me an example of a meaningful scenario where we'd have non-measurable random variables?

The reason I ask is because I'm working on this homework problem:

> 
> Given $(\Omega,\mathcal{A}, P)$, let $\mathcal{A}'=\{A ∪ N:A ∈ \mathcal{A},N ∈ \mathcal{N}\}$, where $\mathcal{N}$ are the null sets (as in Theorem 6.4). Suppose $X = Y$ almost surely where $X$ and $Y$ are two real-valued functions on $Ω$. Show that $X: (Ω,\mathcal{A}') → (\mathbb{R}, \mathcal{B})$ is measurable if and only if $Y : (Ω,\mathcal{A}') → (\mathbb{R}, \mathcal{B})$ is measurable.
> 
> 
> 

But, if these two $\mathcal{B}$'s are just defined as the images of the functions, isn't this trivial?