Let $g\in L^{\infty}([0,1])$ (with respesct to Lebesgue measure). Prove that if $$\int_{[0,1]} f(x)g(x) = 0$$ for all continuous functions $f$ on $[0,1]$ then $g(x) =0$ almost everywhere.
I usually do not post without an attempted proof but I am completely lost with this one, a detailed solution should help me but any thing is grealtly appreciated.
Clearly, $g\in L^2[0,1]$ as well, and extending $g$ left and right of $[0,1]$, by setting it being equal to zero, we consider $$ g_\delta(x)=\frac{1}{2\delta}\int_{-\delta}^\delta g(x+t)\,dt. $$ Then $g_\delta\in C[0,1]$ and $\|g_\delta-g\|_{L^2}\to 0$, as $\,\delta\to 0$. In particular, $$ 0=\int_0^1 g_\delta(x)\,g(x)\,dx\to \int_0^1 g^2(x)\,dx. $$ Thus $g(x)=0$, a.e.