Let $g\in L^2(\mathbb{R})$. Prove that if for $\forall a,b\in\mathbb{R}$ s.t. $a<b$, $\int_a^b g(x)dx = 0$, then $g = 0$ for a.e. $x$.
I want to prove by contradiction. Suppose $g > 0$ on a set of positive measure, say $E$, then $\exists \epsilon >0$ s.t. $g(x) > \epsilon$ for $\forall x\in E$.
Take an open set $O \supseteq E$ s.t. $m(O) < m(E) + \delta$ for some $\delta > 0$, and $m$ is the Lebesgue measure. And $O = \cup_{n\in \mathbb{N}} (a_n,b_n)$(union of disjoint open intervals), as O is open.
Then $\int_O g(x)dx = \sum_n \int_{a_n}^{b_n} g(x)dx = 0$, but $$\int_O g(x)dx = \int_{O-E} g(x)dx + \int_E g(x)dx > \int_{O-E} g(x)dx + \epsilon m(E)$$ I want make the last term postive so that I can derive a contradiction. But I don't know how to control $g$ on $O$-$E$. Can someone help me with this? Or is there a better way to prove the statement?
$(|\int_{O-E} g(x)dx|)^{2} \leq (\int_{O-E} |g(x)|^{2}dx) (m(O-E)) < \delta ||g||_2^{2}$ by Holder's inequality.