If $f$ is continuous on $[0,1]$ and if $\int\limits_{0}^{1} f(x) x^n dx = 0, (n=0,1,2,...)$, prove that $f(x)=0$ on $[0,1]$.
This is what I have, how does it look?
Proof:
Let $P(x)$ be any polynomial. Then we can write
$P(x) = a_nx^n + a_{n-1}x^{n-1} + ... + a_1x + a_0$.
Hence, we have, by linearity of the integral, that
$\int\limits_{0}^{1} f(x)P(x) dx$
$= \int\limits_{0}^{1} f(x) (a_nx^n + a_{n-1}x^{n-1} + ... + a_1x + a_0) dx$
$= a_n \int\limits_{0}^{1} f(x)x^n dx + ... + a_1 \int\limits_{0}^{1} f(x) x dx + a_o \int\limits_{0}^{1} f(x) x^0 dx$
$=0$.
By the Weierstrass Theorem (Theorem 7.26, Pg. 159, Rudin.), we see that there exists a sequence of polynomials $P_n$ such that $P_n(x) \rightarrow f(x)$ uniformly on $[0,1]$. By the above, we have that $\int\limits_{0}^{1} f(x)P_n(x) dx = 0$ for all $n \ge 1$.
By Theorem 7.16 (Pg. 151, Rudin.), because this convergence is uniform, we can interchange limits and integration and obtain
$0 = \lim\limits_{n \rightarrow \infty} \int\limits_{0}^{1} f(x) P_n(x) dx = \int\limits_{0}^{1} \lim\limits_{n \rightarrow \infty} f(x) P_n(x) dx = \int\limits_{0}^{1} f^2(x) dx$.
But, $f^2(x) \ge 0$ for all $x \in [0,1]$ and since $f^2$ is continuous (because $f$ is and so is the function $x^2$) we must have that $f^2(x) = 0$ for all $x \in [0,1]$, because otherwise it would be nonzero in some neighborhood within $[0,1]$ by continuity, hence the integral would be positive because it would be positive over that neighborhood and greater than or equal to zero over the rest of $[0,1]$. But, $f^2 = 0$ on $[0,1] \implies f = 0$ on $[0,1]$.
Q.E.D.
See my comment. This is another way to use Weierstrass's theorem.
If $f(x)$ is a polynomial, the result is clearly true. However, any continuous function can be approximated by a polynomial, the result is true for any continuous function.
As I said in my comments, I like your answer better, but it is here as alternative.