TITLE: Suppose $f\in L^1(\mathbb R)$ satisfies $\int_G f(x)\,dx=\int_{\bar{G}}f(x)\,dx\ \ \text{for all open set } G\subset\mathbb R$, then $f=0$ a.e.
QUESTION [5 upvotes]: Problem: Suppose $f\in L^1(\mathbb R)$ satisfies 
  $$\int_G f(x) dx=\int_{\bar{G}}f(x) dx\ \ \text{for all open sets } G\subset\mathbb R.$$
  Show that $f(x)=0$ for almost all $x\in\mathbb R$.

My attempt: For any open set $G\subset\mathbb R$, we can write $G=\bigcup_{k=1}^\infty (a_k,b_k)$, where $a_1<b_1\leq a_2<b_2\cdots$. The condition in the problem implies that $\int_{\cup_k\{a_k,b_k\}}f=0$, right? But it seems right for all $f\in L^1(\mathbb R)$ since $m(\cup_k\{a_k,b_k\})=0$. So I'm confused. What did I miss?
Any help will be appreciated.

REPLY [6 votes]: Well known fact: If $f\in L^1(\mathbb R)$ and $m(E_n)\to 0,$ then $\int_{E_n}f \to 0.$
Now suppose $f$ satisfies the given hypotheses. Let $I$ be any open interval. Then there exist open $G_1,G_2,\dots \subset I,$ with each $G_n$ dense in $I,$ such that $m(G_n)\to 0.$ By the above, $\int_{G_n}f \to 0.$ But for each $n,$
$$\int_{G_n}f = \int_{\overline{G_n}}f =\int_I f.$$
It follows that $\int_I f =0.$ Since this is true for any open interval $I,$ we have $\int_G f=0$ for any open $G.$ This gives $f=0$ a.e. as desired.