Is a function determined by its integrals over open sets?

If $f \in L^1(\mathbb R)$ satisfies $$\int_U f = 0$$ for every open set $U \subset \mathbb R$, then is it true that $f = 0$ a.e.?

-
Yes, see the answers to math.stackexchange.com/questions/326749/… – user88576 Jan 19 '14 at 23:48
this question is a duplicate of this one – user88576 Jan 19 '14 at 23:49
@DavidMitra This is not a duplicate, at least in the sense that none of the answers to that question prove that this one has an affirmitive answer. Guisseppe's answer only proves the statement under the assumption that the function is Borel measurable. The $\sigma$-algebra of Lebesgue measurable sets is not generated by the open sets, so Guisseppe's Theorem there does not apply. – Jan Ladislav Dussek Jan 20 '14 at 0:12
@JanLadislavDussek Oops, I missed that. – David Mitra Jan 20 '14 at 0:13

Your assumption implies that $\int_E f = 0$ for every compact set $E$. But since every positive measure set has a positive measure compact subset, none of the sets $\{x : f(x) > 0\}$, $\{x : f(x) < 0\}$ can have positive measure.
Why does the assumption imply that $\int_E f = 0$ for every compact $E$? – Jan Ladislav Dussek Jan 20 '14 at 0:33
Since if $E$ is closed, $\int_E f = \int_R f - \int_{R \backslash E} f = 0 - 0 = 0$. – hot_queen Jan 20 '14 at 0:39
Since $f$ is measurable, the set $A=\{x\in\mathbb{R}\mid f(x)>0\}$ is measurable. Therefore, by regularity of the Lebesgue measure, $m$, for every $\varepsilon>0$ there exists an open set $U$ such that $A\subset U$ and $m(U\setminus A)<\varepsilon$. Let $f^+$ and $f^-$ denote the positive and negative part if $f$. Then, we have $$0=\int_U f\, dm= \int_A f^+\, dm-\int_{U\setminus A} f^-\, dm$$ Note that the measure $\mu$ on the Lebesgue measurable subsets of $\mathbb{R}$ defined by $$\mu(A)=\int_{A} f^-\, dm$$ Is absolutely continuous with respect to $m$. Hence, for every $n$ and $B$ measurable there exists a $\delta_n$ such that $\mu(B)<1/n$ if $m(B)<\delta_n$. Taking $\varepsilon=\delta_n$ yields a sequence of open sets $U_n$ such that $m(U_n\setminus A)<\delta_n$. Hence, we have $$0\leq \int_A f^+\, dm=\int_{U_n\setminus A} f^-\, dm< \frac{1}{n}$$ And this is valid for every $n$. Therefore, we should have $\int_A f^+\, dm=0$ and since $f^+\geq 0$, this implies that $f^+=0$ a.e. Using a similar argument, we can find that $f^-=0$ a.e. which gives the result.