If $\int_0^1 f(x)x^{2n+1}dx=0$ for all but finitely many $n\in\mathbb{N}$, then $f=0$ on $[0,1]$. Let $f$ be continuous real function. Assume $\int_0^1 f(x)x^{2n+1}dx=0$ for all but finitely many $n\in\mathbb{N}$, then $f=0$ on $[0,1]$.
Use Stone-Weierstrass theorem (not change of variables.)
*If we loosen up the problem: say $\int_0^1 f(x)x^ndt=0$ for all but finitely many $n$, without changing the variable how would stone weierstrass work here? 
*What about $x^2n$ for all $n\geq 0$, infinity many terms are 0 and infinity many terms may not be 0?
Thank you!
 A: Müntz–Szász theorem provides an interesting overkill. The series $\sum_{d\geq 0}\frac{1}{2d+1}$ is clearly divergent and it stays so if we remove from it a finite number of terms. It follows that the span of $x^{2d+1}$ is dense in $C^0=[0,1]$, which is dense in $L^2(0,1)$. So if the original identity holds, $f$ has to be $0$ almost everywhere on $(0,1)$. Since $f$ is a continuous function, $f\equiv 0$.

As an alternative, let us consider the polynomials of the form 
$$P_{a,b}(x)=C_{a,b}\, x^{2a+1}(1-x^2)^b$$ 
with $a,b\in\mathbb{N}$, 
with $C_{a,b}$ chosen in such a way that $\int_{0}^{1}P_{a,b}(x)\,dx=1$.
We may chose $a$ and $b$ in such a way that $P_{a,b}(x)\geq 0$ is concentrated in a arbitrarily small neighbourhood of any $x_0\in(0,1)$, since $P_{a,b}$ attains its maximum at $\sqrt{\frac{2a+1}{2a+2b+1}}$. Assume that $f\neq 0$ in a neighbourhood of $x_0\approx\sqrt{\frac{2a+1}{2a+2b+1}}$. Then
$$ \int_{0}^{1}P_{a,b}(x)\,f(x)\,dx $$
is arbitrarily close to both $f(x_0)\neq 0$ and $0$, contradiction.
A: Let $g(x) = xf(x).$ Then $\int_0^1g(x)x^{2n}\, dx=0$ for $n\ge $ some $N.$ In particular
$$\tag 1 \int_0^1g(x)(x^{2N})^m\, dx=0,\,\, m=1,2,\dots.$$
Now by Stone-Weierstrass, polynomials in $x^{2N}$ are dense in $C[0,1].$ Hence there is a sequence of polynomials $p_k$ such that $p_k(x^{2N}) \to g(x)$ uniformly on $[0,1].$ But note $g(0)=0.$ It follows that $p_k(x^{2N})-p_n(0) \to g(x)$ uniformly on $[0,1].$ Since each $p_k(x^{2N})-p_n(0)$ is a finite linear combination of the monomials $(x^{2N})^m,\, m=1,2,\dots,$ we have by $(1)$
$$\int_0^1 g(x)[p_k(x^{2N})-p_n(0)]\,dx = 0$$
for all $k.$ Therefore $\int_0^1 g(x)^2\,dx =0,$ which implies $g\equiv 0,$ hence $f\equiv 0.$
