Let X,Y be two r.v.'s living on the probability space $(\Omega,\mathcal{F},R)$ such that $E[X1_{A}]=E[Y1_A] \forall A\in\mathcal{F}$. Show that X=Y a.s.. What is more, is X=Y surely? Why? Why not?
I have tried this way: consider $(X1_A - Y1_A)$, which is equal to $(X - Y)$ for $\omega \in A$ and equal to 0 otherwise. Take $E(X1_A - Y1_A)$: $$E(X1_A - Y1_A) = (X - Y)Pr(A) + 0Pr(A^C) = (X - Y)Pr(A)$$ Since we know that $E[X1_{A}]=E[Y1_A] \forall A\in\mathcal{F}$, we have, by linearity of expectation on l.h.s: $$0=(X - Y)Pr(A)$$ $$0=XPr(A)-YPr(A)$$ $$XPr(A)=YPr(A)$$ $$X=Y$$ If the above is correct, I think that $X$ and $Y$ are equal both a.s. (that is, with probability 1, since I have considered the whole $\Omega = A \cup A^C$ and surely as well. Is this correct?