I am asked to prove that for given $f:[0,1]\to \mathbb{R}$ continuous, if
$\int_{0}^{1} x^{2n} f(x) dx=0$ for all $n\geq0$, then $f$ is the zero function.
I managed to prove the statement when I have for any power of x (even and odd) but i don't know how to extend it just for the even powers.
Any thoughts if this holds if I replace the even powers with the odd ones?
This will require Stone-Weierstrass. Note first that $$S := \{ \sum_n a_n x^{2n} \ | \ a_n \in \mathbb{R} \}$$ is an algebra that separates points and contains constants. By Stone-Weierstrass, $S$ is dense in $[0,1]$ under the $L^1$ norm. Let $\epsilon >0$; choose $p \in S$ such that $|| f - p ||_1 < \epsilon/(||f||_\infty + 1)$. Observe that the condition $\int_0^1 f(x) x^{2n} dx = 0$ for all $n$ implies that $\int_0^1 f(x) p(x) dx = 0$ for all $p \in S$ by linearity of the integral. We then see: \begin{equation} \begin{split} \int_0^1 f(x)^2 dx &= \int_0^1 f(x) \big( f(x) - p(x) \big) dx \\ &\leq ||f||_\infty ||f - p||_1 \quad \textrm{(Holder's)} \\ &< \epsilon \\ \end{split} \end{equation} As $\epsilon >0$ is arbitrary, $\int_0^1 f(x)^2 dx = 0$, so that $f = 0 $ almost everywhere, and since $f$ is assumed continuous, $f$ is identically $0$.