TITLE: Showing that $ \int_0^1 x^{2n}f(x) dx = 0 $ implies $f = 0$
QUESTION [5 upvotes]: This is my question:

Show that if $f \in C[0,1]$ satisfies $ \int_0^1 x^{2n}f(x) dx = 0 $, then $f$ is the zero function.

Note: I am aware that a similar question to this has been asked on maths SE at least once, but those questions deal with $ \int_0^1 x^{n}f(x) dx = 0 $, ie $n \in \Bbb N_0$ - I am interested in $ 2n \in 2\Bbb N_0$.
The first part  of the question was to show that it is true when any $n$ is allowed. To show this, it asked me to use the Weierstrass Approximation Theorem (see this question).
The question then continues on to ask whether or not it is true for $x^{2n+1}$. Hopefully, if I can determine for $2n$, then I should be able to adapt that to $2n+1$, or if I can't then come up with a counter-example.
Oh, and please note: I'm interested in learning from this question, so please don't just put the answer without an explanation! If you can, I'd most appreciate a hint as to how to do it, then I'll work it out myself.
Thanks in advance! :)

REPLY [2 votes]: The Stone-Weierstrass theorem (a natural generalization of the Weierstrass approximation theorem) says that polynomials with all terms of even degree are uniformly dense in continuous functions on $[0,1]$, since they form a subalgebra which separates points and contains the constants.  Using this you may proceed as in the proof of the first part.  Note that the Stone-Weierstrass theorem does not apply to polynomials with all terms of odd degree as these don't even form an algebra.