Integration of continuous function Let $f$ be a continuous function with $f: [0,1] \to \mathbb{R}$ such that $$\int_{0}^{1}f(x)x^{n}dx = 0$$ for all non negative $n$. Prove that $f = 0$. 
I tried to think this problem like this: if $f=0$ then it is obvious. If $f$ is positive also I can prove that $f = 0$. In general I started thinking by Weirstrass approximation theorem (every continuous function can be approximated by a polynomial). I don't know if I'm going in the right direction or not. Can someone please tell me the proper proof of this. 
 A: According to Weierstrass Approximation Theorem in mathematical analysis every continuous function can be approximated by a sequence of polynomials, so $f$ itself is the limit of a sequence of polynomials. Take ${P_{n}}$ as the desired sequence. So for any positive number $\epsilon$, there is a big enough number $N$ so that for each $n>N$ we have
\begin{equation}
\lvert f-P_{n}\rvert < \epsilon 
\end{equation}
for every  $x$ in $(0,1)$,
which means that for $n>N$
\begin{equation}
P_{n}-\epsilon<f<P_{n}+\epsilon
\end{equation}
where $P_{n}$ is a polynomial of finite degree. Take $A$ and $B$ be the set of points where $f$ has positive and negative values respectively. Without loss of generality (why?) we can assume that $A\cup B= (0,1)$. So
\begin{equation}
\int_{A}f(x)P_{n}dx - \epsilon \int_{A}f(x)dx<\int_{A}f^{2}(x)dx <  \int_{A}f(x)P_{n} + \epsilon\int_{A}f(x)dxdx
\end{equation}
and
\begin{equation}
\int_{B}f(x)P_{n}dx + \epsilon \int_{B}f(x)dx<\int_{B}f^{2}(x)dx <  \int_{B}f(x)P_{n} - \epsilon\int_{B}f(x)dx
\end{equation}
Combining the two equations, we have:
\begin{equation}
\int_{0}^{1}f(x)P_{n}dx - \epsilon \int_{A}f(x)dx + \epsilon \int_{B}f(x)dx<\int_{0}^{1}f^{2}(x)dx <  \int_{0}^{1}f(x)P_{n} + \epsilon\int_{A}f(x)dxdx - \epsilon \int_{B}f(x)dx
\end{equation}
but according to the assumption:( $\int_{0}^{1}f(x)x^{n}dx = 0$ for any non-negative $n$ ), we have  $\int_{0}^{1}f(x)P_{n}dx = 0$ (why?). So
\begin{equation}
-C\epsilon <\int_{0}^{1}f^{2}(x)dx < C\epsilon
\end{equation}
Where
$$ C = \int_{A}f(x)dx -  \int_{B}f(x)dx$$
Therefore
$$ \lvert \int_{0}^{1}f^{2}(x)dx \rvert < C\epsilon $$.
Since $C$ is a constant number and $\epsilon$ is an arbitrary number we conclude that $$ \lvert \int_{0}^{1}f^{2}(x)dx \rvert = 0$$
but $f^2$ is a positive function on $(0,1)$ so the above equation implies that
$f(x)=0$ on $(0,1).$
