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!