Problem
Show that the number sequence $\sin n^2$ is divergent.
My Proof
Assume that $\lim\limits_{n \to \infty}\sin n^2=L.$ Then,
\begin{align*} \int_0^{+\infty}\cos x {\rm d}x&=\lim_{n \to \infty}\int_0^{n^2}\cos x {\rm d}x\\ &=\lim_{n \to \infty}\sum_{k=0}^{n-1}\int_{k^2}^{(k+1)^2}\cos x {\rm d}x\\ &=\lim_{n \to \infty}\sum_{k=0}^{n-1}\left[\sin(k+1)^2-\sin k^2\right]\\ &=\lim_{n \to \infty}\sin n^2\\ &=L. \end{align*}
But, in fact, the infinite integral on the left side is divergent, since $$ \int_0^{+\infty}\cos x {\rm d}x=\lim_{t \to +\infty}\int_0^t\cos x {\rm d}x=\lim_{t \to +\infty}\sin t,$$ the last limit does not exist. Thus, the contradiction comes out.
Please correct me if I'm wrong.Thanks in advance.
No, it is not correct. It is true that$$\int_0^{+\infty}\cos x\,\mathrm dx=\lim_{n \to \infty}\int_0^{n^2}\cos x\,\mathrm dx,$$but with $n\in\mathbb{R}^+$. You are assuming that $n\in\mathbb N$.