Showing sets have measure zero. Let $L=L(X,\textbf{X},\mu)$ denote the set of an integrable functions. Recall, we define the indefinite integral of $f$ by $$\lambda(E)=\int_{E} f \, d\mu$$ for $E \in \textbf{X}$. Let $f_1$ and $f_2$ be in $L$ and let $\lambda_1$ and $\lambda_2$ be their indefinite integrals. Show that $\lambda_1 (E) = \lambda_2 (E)$ for all $E \in \textbf{X}$ if and only if $f_1(x)=f_2(x)$ for almost all $x \in X$.

Similar to my last question, I am having trouble with one direction of the proof. I am assuming $\lambda_1 (E) = \lambda_2 (E)$ for all $E \in \textbf{X}$. My idea is to show that the set $F= \{x \in X: f_1(x)\neq f_2(x)\}$ has measure $0$. The rational numbers are countable; hence, they can be indexed by the natural numbers. Let $(r_n)$ be the sequence of rational numbers. Set $$ F_n = (\{x \in X: f_1(x)>r_n\} \cap \{x \in X: f_2(x)<r_n\}) \cup (\{x \in X: f_1(x)<r_n\} \cap \{x \in X: f_2(x)>r_n\})$$ for each $n$. Then, $\bigcup F_n = F$. But, I am not too sure how to show that $\mu(F_n)=0$ for each $n$. Or, perhaps, there is a much easier way. Based on this and my previous question, it appears I am lacking in techniques of how to show sets have measure $0$. Any help would be greatly appreciated. Thank you!
 A: Write $F_n=F'_n\cup F''_n$, where $F'_n=\{f_1>r_n\}\cap\{f_2<r_n\}$ and similarly for $F''_n$. We have to show that $\mu(F'_n)=0$ for each $n$. Fix $n$, and define $A_k:=\{f_1>r_n+k^{-1}\}\cap \{f_2<r_n\}$. Then $F'_n=\bigcup_k A_k$. We have 
$$r_n\mu(A_k)\geqslant \int_{A_k}f_2\mathrm d\mu=\int_{A_k}f_1\mathrm d\mu\geqslant (r_n+k^{-1})\mu(A_k),$$
hence $\mu(A_k)=0$.
A: Hint:  If the set where $f_1(x) \neq f_2(x)$ has measure greater than 0, try to show there either there is a set with positive measure where $f_1(x) > f_2(x) + \epsilon$, or a set with positive measure where $f_2(x) > f_1(x) + \epsilon$, for some $\epsilon > 0$.  I.e., what happens if you get measure zero for all $\epsilon$?  Your idea of using rationals to establish countably many sets may come in handy.
A: Your question boils down to showing that:
$$
f = 0 \text{ [a.e.]} \iff \forall E \in \mathbf{X} : \int_E f \,d\mu = 0
$$
The direction ($\implies$) is easy. Let's show the other direction. First, assume $f$ is non-negative. Consider the set $A_n = \left\{x \in X : f(x) > 1/n\right\}$. We have:
$$
\frac{\mu(A_n)}{n} \le \int_{A_n} f \,d\mu = 0
$$
Thus, $\mu(A_n) = 0$ for all $n$. It follows that $\mu\left(\left\{x \in X : f(x) > 0\right\}\right) = 0$ as desired.
Now, assume $f$ is real and fix $E \in \mathbf X$. Let $A = \left\{x \in E: f(x) \ge 0\right\}$. Since $\int_A f \, d\mu = 0$, it follows that:
$$
\int_A f \,d\mu = \int_E f^+ \,d\mu = 0
$$
Hence $f^+ = 0$ [a.e.] by the first step of this proof (since $E$ is arbitrary). Similarly, $f^- = 0$ [a.e.]. Thus, $f = 0$ [a.e.].
A: Necessity. Suppose that  $\{ x : x \in X ~\&~f_1(x) \neq f_2(x)\}$ has positive $\mu$-measure. Then without loss of generality we can assume that $\mu(E_1)>0$  or $\mu(E_2)>0$, where  $E_1=\{ x : f_1(x)>f_2(x)\}$ and  $E_2=\{ x : f_1(x)<f_2(x)\}$. Note that if $\mu(E_1)>0$, then we get 
$\int_{E_1}f_1(x)d\mu(x) > \int_{E_1}f_2(x)d\mu(x)$ which contradicts to the condition that $\int_{E}f_1(x)d\mu(x)=\int_{E}f_2(x)d\mu(x)$ for each $E \in \cal{X}$. Similarly, if
$\mu(E_2)>0$ then we get  $\int_{E_2}f_1(x)d\mu(x) < \int_{E_2}f_2(x)d\mu(x)$ which also contradicts to the condition that $\int_{E}f_1(x)d\mu(x)=\int_{E}f_2(x)d\mu(x)$ for each $E \in \cal{X}$. Hence we must have $\mu(\{x : f_1(x) \neq f_2(x)\})=0.$
Sufficiency. So  $\mu(\{x : f_1(x) \neq f_2(x)\})=0$ for $E \in \cal{X}$ we have
$$\int_{E}(f_1(x)-f_2(x))d\mu(x)=\int_{\{ x: x \in E ~\&~ f_1(x) \neq f_2(x)\} }(f_1(x)-f_2(x))d\mu(x)+
$$
$$
 \int_{ \{x: x \in E ~\&~ f_1(x)=f_2(x)\} }(f_1(x)-f_2(x))d\mu(x)=0.$$ The latter relation implies that $\int_{E}f_1(x)d\mu(x)=\int_{E}f_2(x)d\mu(x)$.
