I'm trying to solve the following old exam question from my analysis class:
Suppose $f$ is a compactly supported measurable function, such that for all integers $n\ge0$, \begin{equation} \int_{-\infty}^\infty f(x)x^ndx=0 \end{equation} Prove that $f(x)\equiv 0$ almost everywhere.
Here's my original line of thinking: if the support of $f(x)$ is contained in $[a,b]$, then it is straightforward to show $f\in L^1([a,b])$. Thus $f$ can be approximated by continuous functions, and continuous functions are uniformly approximated by polynomials, so we can show $f\equiv 0$ in $L^1$.
The problem is, I don't know how to make this argument precise. When I try to write it out, I end up with a sequence of continuous functions that seem to converge to $f$, but it's unclear if they converge uniformly to $0$.
Is this a good approach to solving this problem? Is there a way to make this approach precise?