If $X = E[X|\mathscr{G}]$ a.e. then $X$ is $\mathscr{G}$ -measurable? Let $(\Omega, \mathscr{F}, P)$ be a measure space with filtration $\{\mathscr{F}_n\}_{n \in N}$. Let $A_n$ be adapted to the filtration $\mathscr{F}_{n}$, and $E|A_n - E[A_n| \mathscr{F}_{n-1}]|=0$, i.e. $A_n = E[A_n | \mathscr{F}_{n-1}]$ a.e -P. How do we get that $A_n$ is $\mathscr{F}_{n-1}$-measurable from this? 
All we have here is that $A_n$ agrees with the $\mathscr{F}_{n-1}$-measurable function $Y$ that has $\int_C YdP = \int_C A_n dP$ for all $C \in \mathscr{F}_{n-1}$. How do we get that $A_n$ must be $\mathscr{F}_{n-1}$-measurable as well?
 A: This is not true unless $\mathcal{G}$ contains all the $\mathsf{P}$-null sets in $\mathcal{F}$ (and $\mathcal{F}$ is $\mathsf{P}$-complete). For a counterexample take $\mathcal{G}=\{\emptyset,\Omega\}$ and $X=1_{A}$, where $\mathsf{P}(A)=0$.

If $\mathcal{G}$ satisfies the above-mentioned assumption, then for a version $Y$ of $\mathsf{E}[X\mid\mathcal{G}]$ and any Borel set $B$,
$$
X^{-1}(B)=(X^{-1}(B)\cap N)\cup(Y^{-1}(B)\cap N^{c})\in\mathcal{G},
$$
where $N\equiv\{X\ne Y\}$, and thus $X$ is $\mathcal{G}$-measurable.
A: We can't, because the statement is not true.
Assume, that our probability space is $[0,1]$ with its Borel algebra $\mathcal{B}$ and the Lesbegue measure $m$. Let $\mathcal{F}=\{\emptyset,[0,1]\}$ be the trivial algebra. Then, for any $X\in L^1,$ we have $\mathbb{E}(X|\mathcal{F})=\mathbb{E}(X),$ which is almost surely equal to $1_{\mathbb{[0,1]}\setminus \mathbb{Q}}\cdot \mathbb{E}(X),$ which isn't constant and hence, isn't  $\mathcal{F}$-measurable. 
Note that $E(X)=0$ doesn't imply that $X=0$ almost surely unless $X$ is positive.
