I need to prove the statement:
Let $g: \mathbb{R} \to \overline{\mathbb{R}}$ be Lebesgue integrable. If $\int_K g \, d m = 0$ for every compact $K \subset \mathbb{R}$, then $g = 0$ a.e.
Note that $m$ is the Lebesgue measure. Here's what I have so far:
Proof
Suppose to the contrary that $m([g>t]) > 0$ for some $t > 0$. Recall that $m([g>t]) = \sup\{m(K) : K \ \text{is compact and} \ K \subset [g>t]\}$.
Choose $K \subseteq [g>t]$ such that $m([gg>t]) > m(K) \geq m([g>t])/2$. Then notice
$$ 0 = \int_K g \, dm = \int g\chi_{_K}\, dm \geq \int t\chi_{_K} \, dm \geq tm(K) > 0. $$
This is a contradiction to the fact that $tm(K)$ is a positive number, and so we must conclude that $m([g>0]) =0 $. A similar argument shows that $m([g<0]) = 0$. This proves that $m([g\neq0]) = 0$.
If, on the contrary, $\mathrm{X} = \{g > t\}$ for some $t > 0$ had positive measure, then, by intersecting with a large compact set, we can assume $\mathrm{X}$ has compact closure and, in particular, finite measure. The regularity of the measure allows deducing that there exists a compact $\mathrm{K}$ contained in $\mathrm{X}$ whose measure is at least half that of $\mathrm{X}$ and therefore a contradiction. Q.E.D.