Why $\sin(nx)$ converges weakly in $L^2(-\pi,\pi)$?

$\newcommand{\norm}[1]{\lVert{#1}\rVert}$Up to a constant, the functions $\sin nx$ are elements of the standard orthonormal basis in the Hilbert space $L_2(-\pi,\pi)$. (The constant is the same for all $n$'s.)

If $\{e_n; n\in\mathbb N\}$ is an orthonormal basis in some Hilbert space $X$, then for any $f\in X$ we have $$f=\sum_{n\in\mathbb N} \langle f,e_n \rangle e_n$$ and $$\norm{f}^2 = \sum_{n\in\mathbb N} |\langle f,e_n \rangle|^2.$$

This formula is called Parseval's identity.

The fact that the series $\sum\limits_{n\in\mathbb N} |\langle f,e_n \rangle|^2$ converges implies that $\langle f,e_n \rangle \to 0$. This is true for each $f$, which means that $e_n$ converges weakly to $0$.


Edit: My previous proof was incorrect, showing that $\sin(x/n)\to 0$ weakly rather than $\sin(nx)$.

Note that $\sin(nx)\in L^2([a,b])$ for any $a,b\in\mathbb R$ but $\sin(nx)\notin L^2(\mathbb R)$, so I assume you are working over some finite interval $[a,b]$. To see that $\sin(nx)\to 0$ weakly, note that the linear functionals on $L^2([a,b])$ are of the form $\int_a^b f(x)\cdot dx$ where $f\in L^2([a,b])$. For any $f\in L^2([a,b])$ and $\epsilon>0$, we have some step function $f'\in L^2([a,b])$ such that $\|f-f'\|_2<\epsilon$. Since $f'$ is a step function, we have (by definition) constants $c_1,\ldots,c_n$ such that $a=c_1<\cdots<c_n=b$ and $f'$ is constant on the intervals $[c_i,c_{i+1})$. Note that we need only show that $\lim\limits_{n\to\infty}\int_{c_i}^{c_{i+1}} f'(x)\sin(nx)dx=0$ for each $i$, as we can then put these together to get that $\lim\limits_{n\to\infty}\int_{a}^{b} f'(x)\sin(nx)dx=0$ and since $\int_a^b \sin(nx)\cdot dx$ is a continuous functional and $\|f-f'\|$ can be made arbitrarily small this shows that $\lim\limits_{n\to\infty}\int_{a}^{b} f(x)\sin(nx)dx=0$. But we see that $$\begin{eqnarray}\lim\limits_{n\to\infty}\int_{c_i}^{c_{i+1}} f'(x)\sin(nx)dx &=& f(c_i)\lim\limits_{n\to\infty}\int_{c_i}^{c_{i+1}} \sin(nx)dx\\ &=& \lim\limits_{n\to\infty}f(c_i) \left(\frac{\cos(nc_{i})}{n}-\frac{\cos(nc_{i + 1})}{n}\right)\\ &=&\lim\limits_{n\to\infty}\frac{f(c_{i})}{n}\big(\cos(nc_{i})-\cos(nc_{i + 1})\big)=0 \end{eqnarray}$$ thus $\sin(nx)\to 0$ weakly.

This technique is fairly standard for proving uniform convergence of $L^2$ functions: you prove convergence for any linear functional defined by a step function and then use the density of step functions in $L^2$ to complete the proof.