I'm given two random variables $X,Y$ with finite second moments such that $\mathbb E(X|Y) = Y$ a.s. and $\mathbb E(X^2|Y) = Y^2$ a.s. and I have to show that $X=Y$ a.s.
I've used the definition of conditional variance and the law of total variance to show that $var(X) = var(Y)$ a.s. But it doesn't help too much since what I need to show is that $\mathbb P(X=Y) = 1$.
Any small hint would be appreciated :)