Proving that $\int_0^1 f(x)e^{nx}\,{\rm d}x = 0$ for all $n\in\mathbb{N}_0$ implies $f(x) = 0$

I’m trying to show that if $f$ is a continuous function on $[0,1]$ and $\int_0^{1} f(x)e^{nx}\,{\rm d}x = 0$ for all $n = 0, 1, 2, \dots$, then $f(x) = 0$.

I’d like to use Weierstrass approximation theorem to find a sequence of polynomials $p_m$ that converge uniformly to $f(x)$. Then we could say $\lim\limits_{m\to \infty} \int p_m(x)e^{nx}\,{\rm d}x = \int f(x)e^{nx}\,{\rm d}x = 0$, but I’m struggling to deduce that then all the $p_m$ are zero which would give the result.

Solutions Collecting From Web of "Proving that $\int_0^1 f(x)e^{nx}\,{\rm d}x = 0$ for all $n\in\mathbb{N}_0$ implies $f(x) = 0$"

Make a change of variables $u = e^x$

$$\int_0^1 f(x) e^{nx}dx = \int_{1}^e g(u) u^{n}du = 0$$

where $g(u) = \frac{f(\log(u))}{u}$ is a continuous function. You can now apply Weierstrass approximation theorem. Since the above holds for all $n$ we have that

$$\int_{1}^e g(u) P(u)du = 0$$

for any polynomial $P(u)$. Now pick the polynomial to approximate $g$ to within an $\epsilon$ on $[1,e]$ and then take $\epsilon\to 0$ to obtain

$$\int_{1}^e g^2(u)du = 0$$

and it follows that $\frac{f(\log(u))}{u} = 0 \implies f\equiv 0$.