Let $(X,\mathcal{B},\mu)$ be a probability space, $\mathcal{A}\subset\mathcal{B}$ a sub-$\sigma$-algebra, then by an easy application of the Radon-Nikodym Theorem, letting $\nu(A)=\int_A\, f\,\mathrm{d}\mu\,\forall A\in\mathcal{A},\, f\in L(X,\mathcal{B},\mu)$, we have that $\nu\ll\mu\mid_A$, and therefore $\exists!\,E(f\mid\mathcal{A})\in L(X,\mathcal{A},{\mu\mid_A})$ s.t. $\nu(A)=\int_A\,f\,\mathrm{d}\mu = \int\,E(f\mid\mathcal{A})\,\mathrm{d}\mu\,\forall\,A\in\mathcal{A}$, unique up to modifications on a $\mu$-measure-zero set.
I'm struggling to prove, however, that $\int_A\,fg\,\mathrm{d}\mu=\int_A\,gE(f\mid\mathcal{A})\mathrm{d}\mu\,\forall\,A\in\mathcal{A}$, whichis necessry and sufficient to prove the theorem.
If I'm understanding correctly, I think you can prove the result by first proving the result when $g$ is an indicator function of sets, then for simple functions $g$ (by linearity), then for positive functions $g$ (by monotonicity), and then finally for integrable functions $g$ (by splitting the positive and negative portions and applying the result separately).