Let $f$ integrable in $(-\infty,\infty)$ prove $$\lim_{n\rightarrow\infty}\int_{-\infty}^{\infty}f(x)\cos(nx)dx=0$$
My attempt
Let $g_n(x)=\cos(xn)f(x)$ note $g_n$ is measurable. Then $|g_n(x)|=|\cos(nx)f(x)|=|\cos(nx)||f(x)|\leq|f(x)|$ as $f$ is integrable then $|f(x)|$ is integrable.
Then, by Dominated Convergence Theorem we have:
$$\lim_{n\to\infty}\int_{-\infty}^\infty (\cos xn)f(x)dx = \int_{-\infty}^\infty \lim_{n \to \infty}(\cos xn)f(x)dx$$
Here I'm stuck. Can someone help me?