Proving $\,f$ is constant. Let $\,f:[a,b] \rightarrow  \Bbb R $ be  continuous 
and  $\int_a^b f(x)g(x)\,dx=0$, whenever $g:[a,b] \rightarrow  \Bbb R $ is  continuous and $\int_a^b g(x)\,dx=0$.
Show that $f$ is a constant function.
I tried a bunch of things including the mid-point integral theorem(?) but to no avail.
I'd appreciate an explanation of a solution because I really don't see where to go with this one..

You can also consider the Hilbert space $H=L^2([a,b])$ for this; set $$K=\left\{h\in H\Big{|}\int_a^bh(x)\,dx=0\right\},$$ then $K$ is a subspace of $H$, of codimension $1$. From density, we should have that $\left<f,h\right>=0$ for any $h\in K$, where $\left<\cdot,\cdot\right>$ is the inner product in $H$, therefore $f\in K^{\perp}$. But, $K^{\perp}$ has dimension $1$, and constant functions are contained in it, therefore $K^{\perp}$ is the subspace of constant functions. This shows that $f$ is a constant.
