Lebesgue integral, open set and closure This is one of the problem in my final exam. 
The following integral is talked in the sense of Lebesgue's. Suppose $f$ is integrable on the real line.
If for any open set $G\subset R$, $$\int_Gfdx=\int_{\overline{G}}fdx$$
Then $f = 0,a.e.$
I managed to prove the proposition when $f$ is nonnegative. Let any $\epsilon>0$ be given. Suppose $f$ is nonnegative and let the ordering of all rational numbers on real line be $\{q_n\}_{n\geq 1} $. Let $q_n \subset E_n $, where $E_n$ is an open interval and $m(E_n)\leq\frac{\epsilon}{2^n}$. Set $E$ be the union of all $E_n$'s, it follows that $E$ is open and $m(E)\leq\epsilon$. It holds for all $\epsilon$. 
Now $E$ is a covering of all rational numbers, it follows that $\overline{E}=R$. By the assumption, $\int_Rfdx=\int_Efdx$. Choose $\epsilon$ so small that the integral on the right hand is smaller than an arbitrarily positive real number, we have that $\int_Rfdx\leq0$. Since $f$ is nonnegative, $f = 0, a.e.$, as desired. 
But I have trouble extending to the general case. I think I'm pretty close though, but I'm stuck. Can anyone give me a hint? 
Thanks!
I would further specify the problem I encountered during the generalization: 
As Harmonic Analyst answered, I tried to generalize it by decomposing $f$ into $f^+$ and $f^-$, where $f^+,f^-$ are nonnegative and $f=f^+-f^-$.
Let $E^+={f>0}$, then for any set $G$, 
$$\int_{G}f^+dx = \int_{G\cap E^+}fdx $$
Now if we can prove that 
$$\int_{G}f^+dx = \int_{\overline{G}}f^+dx $$
We would finish the proof. 
This is equivalent to 
$$\int_{G\cap E^+}fdx = \int_{\overline{G}\cap E^+}fdx $$
But how can this be deduced from the given condition? The concerned set ${G\cap E^+}$ is not open, and $\overline{G}\cap E^+$ is not even its closure. 
This is the difficulty that stopped me. I'm also beginning to think I'm headed to a wrong direction. Again, thanks in advance! 
 A: $\def \R{\mathbb{R}}$
My answer is quite similar to your method. I claim that for any $a<b$,  we have $$\int_a^b f(x) dx = 0.$$
In fact, as you did, let $\{q_n\}_{n\geq 1}$ be all the rationals on $(a, b)$ (not on $\R$). For each $\epsilon>0$ there is an open set $V_{\epsilon}$ such that $\{q_n\}_{n\geq1} \subset V_{\epsilon} \subset (a, b)$ and $m(V_{\epsilon}) < \epsilon $. Here $m$ denotes the Lebesgue measure. Since the closures of $\{q_n\}_{n\geq 1}$ and $(a, b)$ are both $[a, b]$, we see the closure of $V_{\epsilon}$ is $[a, b]$ as well. The the given condition yields 
$$\int_a^b f(x) dx = \int_{V_{\epsilon}} f(x) dx \to 0 \quad(\epsilon \to 0).$$
The limit follows from the fact that $m(V_{\epsilon}) \to 0$ and an application of the Dominated Convergence Theorem. From this observation it is easy to check that $f = 0$ a.e. 
A: I think you could just use some standard argument, decomposing an arbitrary function $f$ in $f^+$ and $f^-$, and using your proof for each of this functions. I.e.:
$$ f^+(x):=max\{f(x),0\};~~ f^-(x):=max\{-f(x),0\}$$
