Why do converging to zero integrals imply zero function? Let Lebesgue integrable function $f:\ [0,1]\mapsto \mathbb{R}$ satisfy
$
\int_0^1 x^{2n} f(x) dx =0\quad \forall n=0,1,2,...
$
Prove that $f=0$ a.e.
I proceed as follows:
Let $\exists\, E$ with nonzero measure such that $f(x)\neg0$ for all $x\in E$.
Let $E_1$ and $E_2$ be the subsets of $E$ where $f$ is positive or, respectively, negative.
Then $\forall\,n\geq 0$, $\int_{E_1} x^{2n}|f(x)| dx = \int_{E_2} x^{2n}|f(x)|dx$.
Thus, now I consider positive function. Should I approximate it by step functions? Maybe it will work but it seems to me that there should be easier solution.
 A: It looks like there is no no-stepfunction solution. For a step-function approximation of $f(x)$  the solution is as follows. Let $f^+(x)=\frac12 [f(x)+|f(x)|]\geq0$, $f^-(x)=\frac12 [|f(x)|-f(x)]\geq0$ and $g^+$, $g^-$ - stepfunction $\varepsilon$-approximations of $f^+$ and $f^-$. Let $(a,b)$ be the rightmost interval of positivity for either $g^+$ or $g^-$, let for $g^+$. Then $\int x^{2n} g^-\leq \int_0^a x^{2n} g^- \leq \frac{a^{2n+1}}{2n+1} \sup\limits_{0\leq x\leq 1} g^-(x)$.
From the other side,
$$
\int x^{2n}g^+ \geq \int_a^b x^{2n} g^+ \geq 
\left( \frac{b^{2n+1}}{2n+1} - \frac{a^{2n+1}}{2n+1}\right) g^+(\frac{a+b}2).
$$
For sufficiently large $n$, $\left(\frac{b^{2n+1}}{2n+1} - \frac{a^{2n+1}}{2n+1}\right) g^+((\frac{a+b}2)$ is greater than  $\frac{a^{2n+1}}{2n+1} \sup\limits_{0\leq x\leq 1} g^-(x)$. Thus, for large $n$, $\int x^{2n}g^+ \not = \int x^{2n} g^-$, they cannot be equal for all $n$ and compensate each other providing zero $\int x^{2n} f(x) dx=0$.
A: Since our $f$ is measurable, we know that the integral is $\epsilon$-close to that of some simple function, so we can pass to the case of simple functions.  Then, this is obvious - the countable sum of of positive nonzero elements cannot be zero.
