Suppose that $f$ is continuous on $[a, b]$ and $\int_{a}^{b} fg = 0$ for every continuous function $g$ on $[a, b]$. Prove that $f = 0$.
My attempt: since $\int_{a}^{b} fg = 0$ for every continuous function $g$ on $[a,b]$, in particular taking $g(x) = 1$ for all $x \in [a, b]$ we get $$ 0 = \int_{a}^{b}f(x)dx. $$ Now to finish the proof I assume that I have to use the hypothesis that $f$ is continuous. What comes to my mind is the mean value theorem for integrals, to get a point $c \in (a, b)$ such that $$ 0 = \int_{a}^{b} f(x)dx = f(c)(b-a), $$ from what I can conclude that $f(c) = 0$, but this holds for some $c$, not for all of them. How should I proceed?