Proving $f(x) = 0$ for almost every $x\in \mathbb{R}$ Can someone help me with the following, please? I am strugging proving this.
Let $f: \mathbb{R} \to \mathbb{R}$ be a Lebesgue integrable function such that $$\int_a^b f(x) dx=0 \hspace{20pt} \text{ for every } a<b.$$
Show $f(x) = 0$ for almost every $x\in \mathbb{R}$
 A: Let $\mathcal{C}=\{(a,b]\mid a<b\}$ and $\mathcal{L}=\{A\in\mathcal{B}(\mathbb{R})\mid\int_{A}f(x)dx=0\}.$
Clearly $\mathcal{C}$ is a $\pi$-class and $\sigma(\mathcal{C})=\mathcal{B}(\mathbb{R})$.
Also, it is given that $\mathcal{C}\subseteq\mathcal{L}$. We go to
check that $\mathcal{L}$ is a $\lambda$-class. Clearly $\emptyset\in\mathcal{L}$.
By Dominated Convergence Theorem, $\int f(x)dx=\lim_{n\rightarrow\infty}\int_{-n}^{n}f(x)dx=0$.
We have that $\int_{A^{c}}f(x)dx+\int_{A}f(x)dx=\int f(x)dx=0$,
so $\int_{A^{c}}f(x)dx=-\int_{A}f(x)dx=0$. That is, $A\in\mathcal{L}\Rightarrow A^{c}\in\mathcal{L}$.
Let $A_{1},A_{2},\ldots\in\mathcal{L}$ by pairwisely disjoint. Let
$A=\cup_{n}A_{n}$. By Dominated Convergence Theorem, we have
\begin{eqnarray*}
\int_{A}f(x)dx & = & \int\lim_{n\rightarrow\infty}\sum_{k=1}^{n}1_{A_{k}}f(x)dx\\
 & = & \lim_{n\rightarrow\infty}\sum_{k=1}^{n}\int_{A_{k}}f(x)dx\\
 & = & 0.
\end{eqnarray*}
Therefore, $\cup_{n}A_{n}\in\mathcal{L}$. Hence, $\mathcal{L}$ is
a $\lambda$-class. By Dynkin's $\pi$-$\lambda$ Theorem, we have
$\sigma(\mathcal{C})\subseteq\mathcal{L}$. It follows that $\mathcal{L}=\mathcal{B}(\mathbb{R}).$
Let $A\subseteq\mathbb{R}$ be an arbitrary Lebesgue measurable set.
Choose a Borel set $B$ such that $m(A\Delta B)=0$. Observe that
$B=(A\cap B)\cup(B\setminus A),$ $m(B\setminus A)\leq m(A\Delta B)=0,$
and the union is disjoint, so
\begin{eqnarray*}
0 & = & \int_{B}f(x)dx\\
 & = & \int_{A\cap B}f(x)dx+\int_{B\setminus A}f(x)dx\\
 & = & \int_{A\cap B}f(x)dx.
\end{eqnarray*}
Next, $A=(A\cap B)\cup(A\setminus B),$ $m(A\setminus B)\leq m(A\Delta B)=0$,
and the union is disjoint, so
\begin{eqnarray*}
\int_{A}f(x)dx & = & \int_{A\cap B}f(x)dx+\int_{A\setminus B}f(x)dx\\
 & = & \int_{A\cap B}f(x)dx\\
 & = & 0.
\end{eqnarray*}
Let $A=\{x\in\mathbb{R}\mid f(x)>0\}.$ We prove by contradiction
that $m(A)=0$. Suppose the contrary that $m(A)>0$. For each $n$,
let $A_{n}=\{x\mid f(x)>\frac{1}{n}\}$, then $A=\cup_{n}A_{n}$.
Therefore, there exists $n$ such that $m(A_{n})>0$. Since $A_{n}$
is Lebesgue measurable, so $\int_{A_{n}}f(x)dx=0$. On the other hand,
$\int_{A_{n}}f(x)dx\geq m(A_{n})\cdot\frac{1}{n}>0$, which is a contradiction.
Similarly, we can prove that the set $\{x\mid f(x)<0\}$ has Lebesgue
measure 0. Therefore $f=0$ a.e..
