TITLE: Assume that $ f ∈ L([a, b])$ and $\int x^nf(x)dx=0$ for $n=0,1,2...$.
QUESTION [6 upvotes]: Assume that $ f ∈ L([a, b])$ and $\int x^nf(x)dx=0$ for $n=0,1,2...$.  Prove $f=0$ a.e.  Since there exist polynomials going to f almost everywhere all I would need to do is bring the limit in to prove that $ ||f||_2 = 0$ and then I'm done.  But no success with this.  Thanks for any help.

REPLY [3 votes]: Define
$$
F(x)=\int_a^xf(t)\,\mathrm{d}t\tag{1}
$$
Since $f\in L^1([a,b])$, $F$ is continuous.
By definition, $F(a)=0$. Furthermore, by hypothesis, $\displaystyle F(b)=\int_a^bf(t)\,\mathrm{d}t=0$.
For any polynomial, $p$, let $\displaystyle P(x)=\int_a^xp(t)\,\mathrm{d}t$, which is also a polynomial. Then integration by parts yields
$$
\begin{align}
\int_a^bF(x)p(x)\,\mathrm{d}x
&=F(b)P(b)-F(a)P(a)-\int_a^bf(x)P(x)\,\mathrm{d}x\\
&=0\tag{2}
\end{align}
$$
The Stone-Weierstrass Theorem says that polynomials are dense in $C([a,b])$. Thus, for any $\epsilon\gt0$, there is a polynomial, $p$, so that
$$
\max_{x\in[a,b]}|F(x)-p(x)|\le\epsilon\tag{3}
$$
Thus,
$$
\int_a^b(F(x)-p(x))^2\,\mathrm{d}x\le(b-a)\epsilon^2\tag{4}
$$
Furthermore, using $(2)$, we get
$$
\begin{align}
\int_a^b(F(x)-p(x))^2\,\mathrm{d}x
&=\int_a^bF(x)^2\,\mathrm{d}x+\int_a^bp(x)^2\,\mathrm{d}x-2\int_a^bF(x)p(x)\,\mathrm{d}x\\
&=\int_a^bF(x)^2\,\mathrm{d}x+\int_a^bp(x)^2\,\mathrm{d}x\tag{5}
\end{align}
$$
$(4)$ and $(5)$ imply that
$$
\int_a^bF(x)^2\,\mathrm{d}x\le(b-a)\epsilon^2\tag{6}
$$
Since $\epsilon\gt0$ was arbitrary, we must have
$$
\int_a^bF(x)^2\,\mathrm{d}x=0\tag{7}
$$
Since $F$ is continuous, $(7)$ implies that $F(x)=0$ for $x\in[a,b]$. Thus $(1)$ implies that
$$
f(x)=0\quad\text{a.e.}\tag{8}
$$