If $\int _c^d f(x)\text{dx}=0$ for all $a\le cLet $f:[a,b]\to \Bbb R$ be a measurable function.Then show that 


*

*If $\int _c^d f(x)\text{dx}=0$ for all $a\le c<d\le b$ then $f=0a.e.$

*If $\int _a ^c f(x) \text{dx}$
for all $a\le c\le b$ then $f=0a.e.$


My try:
Let $A^{+}=\{x:f(x)\ge 0\}$ and $A^{-}=\{x:f(x)<0\}$
Let $\phi $ be a simple function such that $\phi\le f$ then  $\int _c^d f(x)\text{dx}=0\implies \int _c ^d \phi=0\implies \sum a_im(E_i)=0$ where $E_i=\{x:\phi(x)=a_i\}$
But I don't know how to show that $f=0$ a.e. from here.Please give some hints
 A: Here's a fast answer. 
Consider the function defined by
\begin{align}
\nu(A) = \int_A f\ dx
\end{align}
which absolutely continuous with respect to the Lebesgue measure $dx$. Observe $\nu([c, d]) = 0$ for all $c, d \in [a, b]$, then by extension we see that $\nu(A)=0$ for all Borel subsets of $[a, b]$. By Radon-Nikodym, there exists a unique measurable $f$ (defined up to a set of Lebesgue measure zero) such that 
\begin{align}
\frac{d\nu}{dx} = f.
\end{align} 
In our case we see that the zero function will define the same measure $\nu$. Hence by the uniqueness we have that $f = 0$ a.e. .
A: First observe that $\int_E f(x)dx=0$ for all Borel measureble sets $E\subseteq[a,b]$. To see this, let
$$\mathcal{S}=\{E\subseteq[a,b]: E\text{ Borel measurable },\int_E f(x)dx=0\}.$$
It is easy to show that $\mathcal{S}$ is a $\sigma-$algebra on $[a,b]$ which contains all sub-intervals of $[a,b]$. Since the Borel $\sigma-$algebra is the smallest $\sigma-$algebra containing intervals, the claim follows.
With this observation, note that
$$\{f(x)\neq 0\}=\left(\bigcup_{n=1}^\infty E_n\right)\cup\left(\bigcup_{n=1}^\infty F_n\right)$$
where
$$E_n=\{f(x)>\frac{1}{n}\},\quad F_n=\{f(x)<-\frac{1}{n}\}$$
Assume $f$ is not $0$ a.e., then without loss of generality at least one $E_n$ (or $F_n$) has possitive measure, whis means
$$\int_{E_n}f(x)dx\geq \frac{1}{n}m(E_n)>0$$
where $m$ denotes the Lebesgue measure. This contradicts the claim we proved at first. Hence the result follows.
