I'm having some trouble with the following exercise:
Let $f,g:[a,b]\to\mathbb R$ be continuous functions such that:$$\int_a^bt^nf(t)dt=\int_a^bt^ng(t)dt$$ for all $n\in \mathbb N$. Prove that $f\equiv g$.
This exercise is at the end of the chapter about the Stone-Weierstrass theorem, so I tried to apply it but I got nowhere. I did the following:
We know that $$\int_a^bt^n(f(t)-g(t))dt = 0$$
for all $n\in \mathbb N$. According to the Stone-Weierstrass, there is a sequence of polynomials $p_k:[a,b]\to \mathbb R$ that converge uniformly to $f-g$. Using this and the integral, I tried to prove that $p_k\to0$, but I wasn't able to do so.
How can this be done?