I realize this is likely a one-line proof, but it isn't coming together in my head.
I mean, I get that if the result didn't hold, that is, say that $E(X\mid \mathcal{F} \not = X$ on some set, $A$, of measure $>0$ then I can integrate over that set on we would get $$ \int_A E(x\mid \mathcal{F}) \, dP \not = \int_A Y \, dP $$ which would violate the definition of conditional expectation.
But I'm sure there is a direct way to prove this? Can someone please provide such a proof (or I'd be okay with part a proof, but I figure it is probably just one line). I feel like I can't say that $$ \tag{1} \int_A E(x\mid \mathcal{F}) \, dP = \int_A Y\,dP \, \forall A\in\mathcal{F} \implies E(X\mid \mathcal{F}) = Y\text{ a.e.} $$ because I think I can find counterexamples to that. But for a direct prove I need to somehow get from (1) to the functions being equal? I was also thinking maybe I can do something along the lines of "look, $Y$ satisfies the definition", but that also seems meh to me, and even if it works I'm not sure how to formalize it.
Thanks.
If $X$ is a random variable with finite expectation and $\mathcal{F}$ is a sub $\sigma$-algebra of the "ambient" $\sigma$-algebra, then $\mathbb{E}[X\mid \mathcal{F}]$ has the following properties: it is $\mathcal{F}$-measurable, $\mathbb{E}[|\mathbb{E}[X\mid \mathcal{F}]|]<\infty$, and $$ \int_AX\;d\mathbb{P}=\int_A\mathbb{E}[X\mid \mathcal{F}]\;d\mathbb{P}$$ for all $A\in\mathcal{F}$.
Moreover, $\mathbb{E}[X\mid \mathcal{F}]$ is the unique random variable having these properties, up to almost-sure equivalence (this is follows from the Radon-Nikodym Theorem).
In particular, if $X$ is $\mathcal{F}$-measurable then it satisfies the three properties above, hence $X=\mathbb{E}[X\mid \mathcal{F}]$ almost surely (i.e. $X$ is a version of $\mathbb{E}[X\mid \mathcal{F}]$).