Show that $\int_0^1 f(x)g(x)\,dx=0$ for all $g\in C([0,1])$ implies $f=0$ almost everywhere Let $f\in L^1([0,1])$ be an absolutely integrable function. Show that if $f$ satisfies 
$$\int_0^1 f(x)g(x)\,dx=0$$
for all continuous function $g\in C([0,1])$, then $f=0$ a.e. 
First consider the case that $f$ is bounded, let $M$ be a bound of $f$. Notice that $C([0,1])$ is dense in $L^{1}([0,1])$, thus we can find a sequence of continuous functions $g_n\in C([0,1])$ such that $\|g_n-f\|_{L^1}\to 0$. Then the claim easily follows from
$$\int_0^1 f^2(x)\,dx=\int_{0}^1 f(x)(f(x)-g_n(x))\,dx\leq M\|f-g_n\|_{L^1}.$$
I don't know how to show the case that $f$ is not bounded?
 A: The boundedness of $f$ is not necessary. The fact that $C[0,1])$ is dense in $L^1$ implies the existence of such a sequence $g_n$ independently of boundedness restrictions on $f.$
Now $f$ itself may not be square integrable, but for fixed constant $R>0$ the maximum of $f$ and $R$ is. Your argument proves that at least the latter function is 0 almost everywhere; the arbitrariness of $R$ then leads to the conclusion that $f$ itself is 0 almost everywhere.
A: For any fixed $f\in\mathcal{L}^{1}([0,1])$ we can define a linear functional $\mathscr{l}_{f}:C([0,1]) \rightarrow \mathbb{C}$ by $$\mathscr{l}_{f}(g)= \int_{0}^{1}g(x)\, f(x) \, dx$$ It is easy to see that $\mathscr{l}_{f}$ is bounded, since indeed $$|\mathscr{l}_{f}(g)|\leq \int_{0}^{1}|g(x)| \, |f(x)| \, dx\leq \sup_{x\in[0,1]}|g(x)| \cdot ||f||_{\mathcal{L}^{1}([0,1])}$$ yielding $||\mathscr{l}_{f}||_{*}\leq ||f||_{\mathcal{L}^{1}([0,1])}$
Moreover we can find a sequence of continuous functions approximating $sgn(f)$, thus by using dominated convergence theorem we can actually prove that $$||\mathscr{l}_{f}||_{*}=||f||_{\mathcal{L}^{1}([0,1])}$$
Now the claim says that $\mathscr{l}_{f}(g)=0$ for all $g\in C([0,1])$, but this can only happen if $\mathscr{l}_{f}\equiv 0$ i.e if and only if $$||f||_{\mathcal{L}^{1}([0,1])}=||\mathscr{l}_{f}||_{*} =0$$ i.e iff $f\equiv 0$ almost-everywhere on $[0,1]$
A: One way is to approximate $1_E$. We shall show that 
$$\int_{[0,1]} f1_E\,dx=0$$
for every measurable subset $E$ of $[0,1]$. 
$f$ is absolutely integrable,  thus uniformly integrable. That is  for every $\varepsilon>0$, we can find a $\delta>0$ such that
$$|\int_{[0,1]} f1_{E}\,dx|\leq \varepsilon$$
for every measurable set $E$ with $m(E)\leq \delta$.  
Now suppose that $E$ is a measurable subset of $[0,1]$. By the regularity of Lebesgue measure, we can find an open set $U$ and a compact set $K$ with $K\subset E\subset U$ such that $m(U\setminus K)\leq \delta$, thus 
$$|\int_{[0,1]} f1_{U\setminus K}\,dx|\leq \varepsilon.$$
By Urysohn's lemma,  we can find a continuous function $g$ with $1_{K}\leq g\leq 1_{U}$. Then we have
$$|\int_{[0,1]} f1_E\,dx|=|\int_{[0,1]} f(1_E-g)\,dx|\leq |\int_{[0,1]} f1_{U\setminus K}\,dx|\leq \varepsilon.$$
Then claim then follows by sending $\varepsilon$ to zero. To finish the proof, we can use the following equality
$$\int_{[0,1]}|f|\,dx=\int_{[0,1]} f1_{f\geq 0}\,dx-\int_{[0,1]}f1_{f<0}\,dx=0.$$
