Prove that a function is equal to a constant.

Take $g(x)=f(x)-\dfrac{1}{b-a}\int_a^b f(x) dx$. Certainly for this choice of $g$, we have that $g$ is continuous and $\int_a^b g(x) dx=0$

We then observe that if $\int_a^b f(x)\,g(x)\,dx=0$, then

$$\int_a^b f^2(x)dx=\dfrac{1}{b-a}\left(\int_a^b f(x) dx\right)^2$$

But by the Cauchy-Scwartz Inequality

$$\left(\int_a^b f(x) dx\right)^2\le \int_a^b f^2(x)\, dx\,\,\int_a^b (1)^2\,dx\implies\,\int_a^b f^2(x)\, dx\ge \dfrac{1}{b-a}\left(\int_a^b f(x) dx\right)^2$$

with equality holding only when $f(x)$ is a constant. And that is that!


Outline, with some middle steps missing.

Show that if the above is true for $f$, the it is true for $f_1(x)=f(x)-C$ for $C$ any constant. Then show:

$$\int_a^b f_1(x)\,dx = 0$$

For a parrticular $C$.

So, let $g(x)=f_1(x)$ and we get tht:

$$\int_a^b f_1(x)^2 \,dx = 0$$

Therefore, show $f_1(x)=0$ for all $x$, and thus that $f(x)=C$ for all $x$.