Consider the following problem, in particular, the second implication:
"Prove that $f$ and $g$ are equal almost everywhere if and only if $\int_Ef\,dm=\int_Eg\,dm$ for every measurable set $E$."
My problem: I've looked at the solution I've been given to the second implication, but I don't see how it actually shows what I'm trying to prove, and I would like help being convinced of it.
Here is an outline of the procedure employed in the solutions.
Start by assuming that $f\neq g$ on a set of positive measure, say $F\subset \mathbb R$. Then, $F=\{x:f(x)\neq g(x)\}$. As far as I can see, this is tantamount to assuming that $f$ is not equal to $g$ almost everywhere.
Then you consider $F$ as $F=\{x:f(x)\gt g(x)\}\cup\{x:f(x)\lt g(x)\}$, and label each as $F_1$ and $F_2$ respectively. It then follows, since we have assumed $F$ to have positive measure, that either $F_1$ or $F_2$ has positive measure. Without loss of generality, we take $F_1$ to have positive measure.
This means that $\forall x\in F_1,\,f(x)-g(x)\gt0$. We move then to compute $\int_{F_1}(f-g)dm$. To determine this integral, we use the fact that for a measurable subset $E\subset\mathbb R$ of positive measure and $f\in\mathcal L(\mathbb R^n,m),$ where $f$ is strictly positive on $E$,then $\int_Ef\,dm>0$. We apply this here to see that $\int_{F_1}(f-g)dm>0$, and then, using the properties of the Lebesgue integral, are able to draw that $\int_{F_1}f\,dm\neq\int_{F_1}g\,dm$.
Now I understand all the little facets used throughout the proof, but I just don't see how it shows the second implication of the problem, namely, that if $\int_Ef\,dm=\int_Eg\,dm$ for every measurable set $E$ then $f$ and $g$ are equal almost everywhere, is true? How is this reasoning sufficient to deduce this? Are there any final details that I have missed that might better tie this all together?
The statement you proved is just the contraposition of the statement you originally wanted to prove.
Now I think the proof you are mentioning is quite complicated and fails to really highlight the main phenomenon here, which is that the Lebesgue integral of a strictly positive function on a measurable set of strictly positive measure has to be positive. (Which is mentioned but buried under a heap of details.)
I would prefer to mimic the proof of this last property, which even yields a shorter proof!
Set $P_n = \{ x \mid f(x) \ge g(x) + 1/n \}$ for positive integer $n$. Then at the same time, we have that
$$\int_{P_n} (f -g) = 0 \mbox{ and }\int_{P_n} (f - g)\ge \lambda(P_n)/n $$
which forces $\lambda(P_n)$ to be $0$. We therefore can present the set where $f > g$ as a countable union of measurables sets of measure $0$ and its measure has to be$0$. By a similar argument the set where $f < g$ has also measure $0$. Therefore $f = g$ almost everywhere.