Let $f\in L^1(R)$. Suppose $\int_{a}^{b} f \,dx\ = 0$ whenever $aLet $f\in L^1(R)$. Suppose $\int_{a}^{b} f \,dx = 0$ whenever $a<b$.
Prove that $f=0 $ a.e.
My approach-
I thought of showing $m({x\in R : f\ne0})=0$
here there are two cases
$$m({x\in R : f>0})=0$$ $$m({x\in R : f<0})=0$$
here m is the measure on R.
Is my approach correct or are there any alternative ways?
 A: You can do this from scratch. Hints:
$1).\ $ First note that it is enough to prove the claim on $[-A,A]$ for an arbitrary $A$.
$2).\ $ Now, if the claim is false then the measure of one of $E^+\{f>0\}$ or $E^-=\{f<0\}$ is strictly greater than zero. Suppose it is the first.  Then, $E^+=\bigcup _n E_n$ where $E_n=\{f>1/n\}.$
$3).\ $ Fix an integer $n$. There are open/closed sets $O/F$ such that $F\subseteq E_n\subseteq O$ with $m(O\setminus E_n)<\epsilon$ and $m(E_n\setminus F)<\epsilon.$
$4).\ 3).$ shows that $\int_{E_n}f(x)dx=\int_O f(x)dx-\int_{O\setminus F}f(x)dx+\int_{E_n\setminus F}f(x)dx$
$5).\ $ The first and second integrals in $4).$ are zero (why?) which implies that $\int_Ff(x)dx=0.$
$6).\ $ But now we have a contradiction because by $3).$ and our hypothesis, $m(F)>0$ if $\epsilon$ is small enough and $\int_F f(x)dx>\frac{1}{n}m(F).$
A: Method 1: This is a consequence of Lebesgue differentiation theorem.
However, the proof of the theorem itself is not easy (e.g., involving
Vitali covering lemma)
Method 2: By invoking Dynkin $\pi-\lambda$ theorem. Let $\mathcal{P}=\{(a,b]\mid a<b\}\cup\{\emptyset\}$
and $\mathcal{L}=\{A\in\mathcal{B}(\mathbb{R})\mid\int_{A}f=0\}$.
We go to show that $\mathcal{P}$ is a $\pi$-class, $\mathcal{L}$
is a $\lambda$-class, and $\mathcal{P}\subseteq\mathcal{L}$. By
Dynkin $\pi$-$\lambda$ theorem, we have that $\sigma(\mathcal{P})\subseteq\mathcal{L}$
and hence $\mathcal{L}=\mathcal{B}(\mathbb{R})$. Finally, let $A=\{x\mid f(x)>0\}$
and $B=\{x\mid f(x)<0\}$. Then $\int_{A}f=\int_{B}f=0$ which implies
that $f=0$ a.e.
