$E[X^2|\mathcal{G}]=2\int_0^{\infty}xP(X>x|\mathcal{G})dx$ Let $X$ a random variable on $(\Omega,\mathcal{F},P),\mathcal{G}$ a sub $\sigma$-algebra. Prove that, almost surely,
$$E[X^2|\mathcal{G}]=2\int_0^{\infty}xP(X>x|\mathcal{G})dx$$
The above formula was true for simple function $X,$ if we pick an increasing function $X_n$ to $X,$ there is a problem in applying the conditional monotone theorem in $\int_0^{\infty}xP(X_n>x)dx$ because $P(X_n>x|\mathcal{G}) \to P(X>x | \mathcal{G})$ on an event $E_x$ (which depends of $x>0$)such that $P(E_x)=1,$ so we can't change interchange limit-integral.
What do you suggest to solve this problem?
 A: I have got a slightly different answer.
Let $P_{\mathcal{G}}$ be your conditional measure (that is $P_{\mathcal{G}}(A)=P(A|\mathcal{G})$), then
$$
E[X^2|\mathcal{G}]= \int X^2 \,dP_{\mathcal{G}}= \int \int_{0}^{\infty}1(X^2>l)\,dl \,dP_{\mathcal{G}} = \int \int_{0}^{\infty}1(|X|>\sqrt{l})\,dl \,dP_{\mathcal{G}}.
$$
Now let $x=\sqrt{l}$ then
$$
E[X^2|\mathcal{G}]=2\int \int_{0}^{\infty}x1(|X|>x)\,dx \,dP_{\mathcal{G}}.
$$
Now use Tonelli's theorem and interchange the integral to get
$$
E[X^2|\mathcal{G}]=2\int_{0}^{\infty}x\int 1(|X|>x) \,dP_{\mathcal{G}}\,dx = 2 \int_{0}^{\infty}xP(|X|>x|\mathcal{G})\,dx.
$$
A: Let $\nu$ denote the regular conditional distribution of $X$ given $\mathcal{G}$. Then for any suitable function $g$,
\begin{align}
\mathsf{E}[g(X)\mid \mathcal{G}](\omega)&=\int g(x)\nu(\omega,dx) \\
&=g(0)+\int_0^\infty g'(x)\nu(\omega,(x,\infty))\, dx-\int_{-\infty}^0 g'(x)\nu(\omega,(-\infty,x])\, dx \quad\text{a.s.}
\end{align}
(See, e.g., this question.)
Now, plug $g(x)=x^2$.
