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!
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.$