It has been shown that given $f \in \mathcal C[0,1]$, we have that if $\int_0^1 x^nf(x)\,dx = 0$ for all $n \in \mathbb N$, then $f = 0$.
I was thinking of generalizing this statement to $L^p$ spaces. For instance, if we have that $f \in L^\infty[0,1]$ instead, and $\int_0^1 x^nf(x)\,dx = 0$ for all $n \in \mathbb N$. Can we say that $f = 0$ a.e on $[0,1]$?
That is, if $f$ is measurable on $[0,1]$, with $\|f\|_\infty = \inf\{a \geq 0 \mid \lambda(|f|^{-1}(a,\infty]) = 0\} < \infty$ given $|f|^{-1}(a,\infty] = \{x \in [0,1] \mid |f(x)| > a\}$, can we show that $f = 0$ for all points in $[0,1]$ except some set $B$ where $\lambda(B) = 0$? In this case, we use $\lambda$ to denote the Lebesgue measure.
Suppose $f\in L^1([0,1])$ (this is weaker than $f\in L^{\infty}([0,1])$) is such that there is an integer $n_0\geq 0$ such that for all $n\geq n_0$, we have $\int_0^1x^nf(x)\,dx=0$. Then, define $\phi(x)=x^{n_0}f(x)$. This lies in $L^1([0,1])$, and for each $n\geq 0$, we have $\int_0^1x^n\phi(x)\,dx=0$. By linearity, this implies that for all polynomials $P(x)$, $\int_0^1P(x)\phi(x)\,dx=0$, and so for all continuous functions $g\in C([0,1])$, and all polynomials $P$, we have \begin{align} \left|\int_0^1g(x)\phi(x)\,dx\right|&=\left|\int_0^1g(x)\phi(x)\,dx-\int_0^1P(x)\phi(x)\,dx\right|\\ &\leq\|\phi\|_1\cdot \|g-P\|_{\infty}. \end{align} By Weierstrass’ approximation, we can uniformly approximate $g$ by polynomials, so $\|g-P\|_{\infty}\to 0$ along a suitable sequence of polynomials, and hence $\int_0^1g(x)\phi(x)\,dx=0$. A basic variant of the fundamental lemma of calculus of variations now tells us that arbitrariness of $g$ implies that $\phi=0$ a.e on $[0,1]$, and so dividing by $x^{n_0}$ on $(0,1]$ implies that $f=0$ a.e on $[0,1]$.