for every $B \in \mathcal{F}$ with $X^{-1}(B) \in \mathcal{F}$ implies $X$ is a measurable function. Here is Proposition 3 (page 12) from Section 2.1 in A Modern Approach to Probability by Bert Fristedt and Lawrence Gray. 

Let $X$ be a function from a measurable space $(\Omega,\mathcal{F})$ to another measurable space $(\Psi,\mathcal{G})$. Suppose $\mathcal{E}$ is a family of subsets of $\Psi$ that generates $\mathcal{G}$ and that $X^{-1}(B) \in \mathcal{F}$ for every $B \in \mathcal{E}$. Then $X$ is a measurable function.

I´m trying to solve this problem in probability but I don´t know how to solve it.
I understand that this problem (if I solve it) says that I can prove that a random variable is measurable from a generator of the algebra and not all the elements of  the algebra.
Someone can help me to prove this please, I´m really stuck with this proposition of the book. Thanks for the help and time.
 A: Consider the set$$\mathcal{F}'=\{X^{-1}(B)\,|\,B\in\mathcal{G}\};$$you want to prove that $\mathcal{F}'\subset\mathcal F$. You know that $B\in{\cal E}\Longrightarrow X^{-1}(B)\in\mathcal{F}$. But then if $B$ is the union of a countable family of elements of $\mathcal E$, it is still true that $X^{-1}(B)\in\mathcal F$, because $\mathcal F$ is a $\sigma$-algebra. And if $B\in\mathcal E$, $X^{-1}(\Psi\setminus B)=\Omega\setminus X^{-1}(B)\in\mathcal F$, again because $\mathcal F$ is a $\sigma$-algebra. So, all elements $B$ of the $\sigma$-algebra generated by $\mathcal E$ have the property that $X^{-1}(B)\in\mathcal F$. In other words, $\mathcal{F}'\subset\mathcal F$.
A: Define $\mathcal G':=\{G\in\mathcal G: X^{-1}(G)\in\mathcal F\}$. You want to show that $\mathcal G'=\mathcal G$; this is just a roundabout way of saying that $X^{-1}(G)\in\mathcal F$ for each $G\in\mathcal G$. By your hypothesis,  $\mathcal E\subset\mathcal G'$. Now check that $\mathcal G'$ is a $\sigma$-algebra. From this it follows that $\mathcal G'\supset\sigma(\mathcal E)=\mathcal G$. Because $\mathcal G'\subset\mathcal G$ by construction, you now have $\mathcal G'=\mathcal G$.
