# A bit of integration involving a continuous function

If $f$ is continuous on $[0,1]$ and if $\int_{0}^{1}f(x)x^ndx=0$ for $n=0,1,2,3...$then $\int_{0}^{1}f^2(x)dx=0$.

This is how I proceeded. For $n=1$, $\int_{0}^{1}f(x)xdx=0$ . (Using by parts) $\implies$ $x\int f(x)dx]_0^1-\int_{0}^{1}(\int f(x)dx)dx=0$. Let $I(x)=\int f(x)dx$. Then $I(1)=\int_{0}^{1}I(x)dx$. For $n=2$ we have $\int_{0}^{1}f(x)x^2dx= x\int xf(x)dx]_0^1-\int_{0}^{1}(\int xf(x)dx)dx=0$

In general for any $n$, $\int_{0}^{1}f(x)x^ndx=x\int x^{n-1}f(x)dx]_0^1-\int_{0}^{1}(\int x^{n-1}f(x)dx)dx=0$.

Then I don't see how I can use this information to get the desired result.

-

By Weierstrass's approximation theorem, $f(x)$ can be approximated uniformly by a sequence of polynomials $p_n(x) \to f(x)$. The assumption implies that for each $n$, $\int_0^1 f(x) p_n(x) dx=0$. Since integration commutes with uniform limits, we have $\int_0^1 f(x)^2 dx = 0$.
Of course this further implies that $f$ identically vanishes.