I'm working on the following problem:
Let $X$ be a random variable defined on $(\Omega,F,P)$ and $G$ a $\sigma$-algebra contained in $F$. Show that, if $E(|X|)<\infty$ and $E(X\mid G)$ has the same distribution as $X$, then $\operatorname{sgn}X=\operatorname{sgn}E(X\mid G)$ almost surely, where $\operatorname{sgn}$ is the sign function.
I tried to find a contradiction when there's a set of events $B$ with positive probability where $X$ and $E(X\mid G)$ have different signs, but I don't know how to use the condition that they have the same distribution.
With the definition of conditional expectation, we have $\int_A E(X\mid G)\,dP = \int_A X \, dP$ for all $A\in G$, so if $B\in G$ then there's a contradiction, while I only know it's in $F$. (Let $B= \{E(X\mid G)>0\} \cap\{X<0\}$).
Could it be proved this way or it needs another approach? Thanks for any help.
Let $Y = E(X \mid G)$. Note that
$$\int X^+ - X^-\, dP = \int X\, dP = \int Y\, dP = \int_{Y>0} Y\, dP + \int_{Y<0} Y \, dP = \int_{Y>0} X\, dP + \int_{Y<0} X \, dP $$
More over since $X$ and $Y$ have the same distribution $E [|X|] = E[|Y|]$. This implies $$\int X^+ + X^-\, dP = \int |X|\, dP = \int |Y|\, dP = \int_{Y>0} Y\, dP - \int_{Y<0} Y \, dP = \int_{Y>0} X\, dP - \int_{Y<0} X \, dP $$
It follows that
$$\int X^+ \, dP= \int_{Y>0} X\, dP$$
Therefore
$$\int X^+ - 1_{Y>0} X\, dP = 0 $$
Since $X^+ \geq 1_{Y>0} X $ we conclude that $X^+ = 1_{Y>0} X$ almost surely.
The case $X^- = 1_{Y<0} X$ almost surely is analogous. This implies that almost surely $X>0$ occurs when $Y>0$ and $X<0$ occurs when $Y<0$