Let $f:([a,b],\vert\vert)\to (\mathbb{R},\vert\vert)$ a continuous function. Show that, if $$\int_{a}^{b}{f(x)x^{n}dx}=0$$ for all $n\in\mathbb{N},n\geq 0$, then f is identically zero.
My attempt: Let $A=\{p\in C[0,1]\vert p(x)=a_{0}+a_{1}x+...+a_{n}x^{n}\}$, then $A$ is a algebra of constant functions and separates points. By Stone-Weierstrass theorem, given $\epsilon>0$, exist $p\in A$ such that $\lVert f-p\rVert<\epsilon$ and as $[0,1]$ is compact and $f$ is continuous, exist $M>0$ such that $\vert f(x)\vert\leq M$. So, $$\vert\int_{a}^{b}{f^{2}(x)dx}\vert=\vert\int_{a}^{b}{f(x)(f(x)-p(x))dx}+\int_{a}^{b}{f(x)p(x)dx}\vert$$ $$\leq \int_{a}^{b}{\vert f(x)\vert \vert f(x)-p(x)\vert dx}\leq M\lVert f-p\rVert<\epsilon M$$ $\therefore\int_{a}^{b}{f^{2}(x)dx}=0$, then $f\equiv 0$. So, for what reason if $\int_{a}^{b}{f^{2}(x)dx}=0$, this implies my problem? Thanks