Deduce that $f=0$ a.e. Let $f:\Bbb R\to \Bbb R$ be a bounded Lebesgue measurable function such that for all $a,b\in \Bbb R$ with $-\infty<a<b<\infty$ we have $\int _a^b f=0$.

Deduce that $f=0$ a.e.

If $U$ is an open set then $U=\cup I_n$ where $I_n$ is a sequence of disjoint open intervals.
Now By Dominated Convergence Theorem we have $\int _Uf=\int _{\cup{I_n}} f=\sum_n \int f=0$
As instructed by @John Ma,I have done upto:
Now if $A$ is a measurable set then there exists an open set $U$ such that $A\subset U $ and $m(U-A)<\epsilon $ forall $\epsilon >0$.
So $\int _U f=\int _{U-A} f +\int _A f\implies \int _A f=\int _{U-A} f\implies |\int _A f|\le \int _{U-A}|f|\le M m(U-A)$  where $|f|\le M$ ;
So we have $|\int _A f |<M\epsilon $ forall $\epsilon >0$ and hence $|\int _A f |=0$
Thus we have  shown  that $\int _A f=0$ forall measurable set $A$.
Now breaking up $A$ as $A^{+}=\{x:f(x)>0\}$ and $A^{-}=\{x:f(x)<0\}$
Considering $A^{+}$ ; $A^{+}=\cup_{i\in \Bbb N} \{x:f(x)>\frac{1}{n}\}$
Problem 1: How to show that $m(A^{+})=0$ from here?
Problem 2: How to show that $m(A^{-})=0$ from here?
 A: Hint: From your assumption, show that 
$$\int_U f = 0$$
for all open sets $U$. Then try to show that 
$$\tag{1} \int_A f = 0$$
for all measureable set $A$. Now you can plug in  $A = \{f>0\}$. 
Note that the boundedness of $f$ can be very helpful, as you can then use some convergence theorems. 
Remarks To show $(1)$, let $U_n$ be a sequence of open set so that 
$$U_1\supseteq U_2\supseteq U_3\cdots \supseteq A,\ \ \ m(U_n-A)<1/n.$$
Then $A = \cap U_n \cup E$, where $m(E) = 0$. 
To see why $m(A^+)  =0$, where $A^+ = \{ f>0\}$. Write, like you said, 
$$A^+ = \bigcup_n \{ f > 1/n\}.$$
Then
$$0 = \int_{A^+} f \ge \int_{ \{f >1/n\}} f \ge \frac 1n m(\{ f>1/n\})\ge 0.$$
implies that $m(\{ f> 1/n\}) = 0$ for all $n$. Thus $m(A^+)=0$. 
A: You can apply the result from your related question, which says that under the same hypotheses ($f$ is bounded, measurable, and $\int_a^b f = 0$ for every interval $(a,b)$), we have
$$\int_E f = 0$$
for any subset $E \subset \mathbb R$ of finite Lebesgue measure. We apply this result as follows.

Let us assume for a contradiction that it is false that $f = 0$ a.e. Then one (or both) of the sets $A = \{x \in \mathbb R : f(x) > 0\}$ or $B = \{x \in \mathbb R : f(x) < 0\}$ has positive measure. Let us assume without loss of generality that $m(A) > 0$ (otherwise replace $f$ with $-f$).

Let $A_n = \{x \in \mathbb R : f(x) > 1/n\}$. Since $A_n \uparrow A$, we have $\lim_{n \to \infty}m(A_n) = m(A)$, so there must be some $A_n$ with positive measure.
Then there must be some interval of the form $[k, k+1)$ such that $E = A_n \cap [k, k+1)$ has positive measure, otherwise by countable additivity $m(A_n) = \sum_{k=-\infty}^{\infty}m(A_n \cap [k,k+1))$ would be zero. Thus we have $f > 1/n$ on the set $E$, so
$$\int_E f \geq m(E)/n > 0$$
But $E$ has finite measure, and $f$ satisfies the hypotheses given in the result cited above, so by that result, we have
$$\int_E f = 0$$
This contradiction resulted from the assumption that $f = 0$ a.e. is false. So in fact $f=0$ a.e.
