If $\int_0^1 f(x)x^n \ dx=0$ for every $n$, then $f=0$. [duplicate]
Solution 1:
We will show that the integral of $f^2$ over $[0,1]$ is 0. This will show that $f$ is zero, because if $f$ were not identically equal to zero, $f^2$ would be positive on some interval (by continuity) and have a nonzero integral.
Using the Stone-Weierstrass theorem, we can approximate $f$ uniformly by polynomials $P_n$ so that $||P_n-f||<1/n$ in the $\sup$ norm. The given condition obviously implies that the integral of $f(x)P(x)$ is zero for any polynomial $P$, by linearity. Note that
$$\left|\int_0^1 f(x)f(x) \ dx \right|=\left|\int_0^1 f(x)f(x) \ dx - \int_0^1 f(x)P_n(x)\right|\le \int_0^1 |f(x)| |f(x)-P_n(x)|\ dx \\\le \frac{1}{n}\int_0^1 |f(x)| \ dx.$$
The last integral is constant, so taking $n$ arbitrarily large completes the proof.