Can we prove the Riemann-Lebesgue lemma by using the Weierstrass approximation theorem?

I’d like to prove the following version of the Riemann-Lebesgue lemma:

Let $f: [0,1] \to \mathbb R$ be continuous. Then $$\int_0^1 f(x)\sin(nx) \, dx \xrightarrow{n \to \infty} 0$$

It’s quite easy to show the lemma for the case $f\in C^1$. So I was hoping that one can approximate the $f\in C^0$ with polynomials (by using the Weierstrass approximation theorem) and then apply the already shown case for $f\in C^1$. Yet it didn’t work out for me. Is this a feasible way?

Solutions Collecting From Web of "Can we prove the Riemann-Lebesgue lemma by using the Weierstrass approximation theorem?"

I think your method is OK.

If $||f-p||_\infty<\epsilon$ then $|\int_0^1 (f(x)-p(x))\sin(nx) \, dx|\leq \int_0^1 |f(x)-p(x)| \, dx<\epsilon$

Hence for large $n$,

$|\int_0^1 f(x)\sin(nx) \, dx|\leq |\int_0^1 (f(x)-p(x))\sin(nx) \, dx| +|\int_0^1 p(x)\sin(nx) \, dx|\leq \epsilon+|\int_0^1 p(x)\sin(nx) \, dx|< 2\epsilon$

Also notice Riemann-Lebesgue lemma is valid for Riemann integrable functions. You can use step functions to approximate $f$ so that the difference of integral is small and show the lemma is valid for step functions by direct computation.