Consider the measurable space $(\Omega,\mathcal F, \mathbb P)$, then show that for random variables $X,Y$ that $X=Y$ almost surely on the measure $\mathbb P$, when both $\mathbb E(|Y|^2|H) = X^2$ and $\mathbb E(|Y ||H) = X$ where $H$ is a sub $\sigma$-algebra on $\mathcal F$.
Using the tower property:
$\mathbb E (\mathbb{E}(|Y ||H)) = \mathbb E(X) \iff \mathbb E(|Y|) = \mathbb E(X)$
$\mathbb E (\mathbb E(|Y|^2|H)) = \mathbb E(X^2) \iff \mathbb{E}(|Y|^2) = \mathbb E(X^2)$
Is this the right line of thinking? I went a little wayward using definitions of variance from here and other things but can't think how to get $X=Y$ a.s.?
The best we can say in this setting is that $X=\lvert Y\rvert$ almost surely (the assumptions are satisfied with $Y=-X$ hence $X=Y$ may not hold).
In order to see this, show that $$ \mathbb E\left[\left(X-\lvert Y\rvert\right)^2\mid\mathcal H\right]=0 $$ by expanding the square and noticing that $X$ is $\mathcal H$-measurable.