Let $X,Y:(\Omega, \mathcal{F}, \Bbb{P})\rightarrow (E,\mathcal{E})$ be random variables. Let us assume that $\mathcal{F}$ is a sigma algebra containing all $\Bbb{P}$-nullsets. I want to show that if $X=Y$ a.s. then if $Y$ is $\mathcal{F}$ measurable, then $X$ is $\mathcal{F}$ measurable.
My idea was to define $B:=\{\omega\in \Omega: X(\omega)\neq Y(\omega)\}$. Then we know that $\Bbb{P}(B)=0$. What I want to show that for all $A\in \mathcal{E}$, $X^{-1}(A)\in \mathcal{F}$. Now I thought about splitting it up into the following sum $X^{-1}(A)=\Bbb{1}_B X^{-1}(A)+\Bbb{1}_{B^c} X^{-1}(A)=\Bbb{1}_B X^{-1}(A)+\Bbb{1}_{B^c} Y^{-1}(A)$. Now since $\mathcal{F}$ contains all nullsets I know that $\Bbb{1}_B$ is $\mathcal{F}$ measurable, and also $\Bbb{1}_{B^c}$. Furthermore by assumption $Y^{-1}(A)\in \mathcal{F}$. But I don't know what to do with $X^{-1}(A)$.
Can someone help me?
With your notation, $$X^{-1}(A)=(X^{-1}(A)\cap B)\cup (X^{-1}(A)\cap B^c)=(X^{-1}(A)\cap B)\cup (Y^{-1}(A)\cap B^c)$$ $Y^{-1}(A)\cap B^c$ is measurable as the intersection of two measurable sets. The set $X^{-1}(A)\cap B$ is measurable since it is a subset of the measure zero set $B$, and is thus measurable by assumption on $\mathcal F$.