If f and g are continuous on {x | a <= x <= b} and the integral of their product is 0, prove that f(x) = 0 Suppose f is continuous on $I=\{x|a \leq x \leq b\}$ and $\int_a^b \! f(x)g(x) \, \mathrm{d}x = 0$ for all functions $g$ which are continuous on $I$. Prove that $f(x) = 0$.
In this case, the integral is the Darboux integral with the definition $\int_a^b \! f(x) \, \mathrm{d}x = \inf\{S^{+}(f,\bigtriangleup)\} = \sup\{S_{\_}(f,\bigtriangleup)\}$, where $S^{+}(f,\bigtriangleup) = \sum\limits_{i=1}^n M_{i}(x_{i}-x_{i-1})$ and $S_{\_}(f,\bigtriangleup) = \sum\limits_{i=1}^n m_{i}(x_{i}-x_{i-1})$, and $M_{i}$ and $m_{i}$ are the l.u.b and g.l.b of f on $I_{i}$ respectively.
What I want to say is that you cannot force $S^{+}(f,\bigtriangleup)$ to $0$ by forcing $(x_{i}-x_{i-1})$ to $0$, since the decrease in subinterval length is offset by the increase in the number of subintervals. Instead, you must force $f(x)g(x)$ to $0$, and since $g(x)$ can be any (non-zero) function continuous on $I$, $f(x)$ must be $0$. 
Is that right? If so, how can I formally state the first sentence of that?
 A: We show that $f^2=0$ and hence that $f=0$. Assume not. Then there is some subinterval $[\alpha,\beta]\subset I$,$\alpha<\beta$ such that $f(x)^2\geq c$ for some $c>0$ and all $x\in J$. If we take $g=f$ we then have
\begin{align*}
0=\int_0^1f(x)^2dx=\int_{I\backslash J}f(x)^2dx+\int_\alpha^\beta f(x)^2dx\geq(\beta-\alpha)c>0,
\end{align*}
a contradiction.
A: Suppose for contradiction that $f$ was not identically 0. Then without loss of generality, there is some $x$ for which $f(x)>0$ (otherwise replace $f$ with $-f$). Since $f$ is continuous, this implies that there is an open interval $(x_-,x_+)$ on which $f>0$. Now take $g$ to be a triangular bump function peaked at the midpoint of the interval, i.e.
$$
g(x)=\begin{cases}
0,& x\not\in (x_-,x_+)\\
\frac{x_-+x_+}{2}-x,& x_-\leq x\leq \frac{x_-+x_+}{2}\\
x-\frac{x_-+x_+}{2},& \frac{x_-+x_+}{2}\leq x\leq x_+ \\
\end{cases}
$$
Choosing a partition of $I$ involving $x_-$ and $x_+$, we see that the lower bound $S_-(fg)$ is strictly positive. Thus $\int_a^b f(x)g(x)\ dx>0$, which is a contradiction.
A: Since $g(x)$ can be any continuous function, try $g = f$. Then the result is that $f^2(x)$ is a non-negative function whose integral over $[a,b]$ is zero...therefore $f(x)$ is identically zero (or does this fact require proof?)
