Prove the Riemann-Lebesgue Theorem: If $f$ is an integrable function on $(-\infty, \infty)$ then
$$
\lim \_{k \rightarrow \infty} \int\_{-\infty}^{\infty} f(x) \cos k x \,dx=0
$$
So the Fourier transform $\hat{f}(k)$ of any $L^1$ function necessarily converges to zero as $|k| \rightarrow \infty$.
Hint: First consider the case in which $f$ is a step function. Then consider the case that $f$ is bounded
and vanishes outside a finite interval $[a, b] .$ Then consider $f \in L^1.$

I have proved the first two steps in the hint. But I don't see how to use them to prove the third step. Any help will be appreciated! Thank you!