Showing $\sin(nx)$ is a complete orthonormal system

I want to prove that the system $\sin(nx)$ for $n=1,2,\cdots$ is complete in $L_2[0,\pi]$, so what I do is assume that:

$$\int_0^\pi f(x)\sin(kx)dx=0,\quad k=1,2,\cdots$$

An define an odd function:

$$\overline{f}(x) =\left\{ \begin{matrix}f(x),&0\leq x\lt \pi\\ -f(-x),& -\pi \leq x \lt 0\end{matrix} \right.$$

And we have that $\int_{-\pi}^\pi \overline{f}(x) dx = 0, \int_{-\pi}^\pi \overline{f}(x)\cos(nx) dx=0 $

Since $\overline{f}$ is an odd function we have:

$$\int_{-\pi}^\pi \overline{f}(x)\sin(nx) dx =2 \int_{-\pi}^\pi \overline{f}(x)\sin(nx)dx=2\int_0^\pi f(x)\sin(nx)d=0$$

Where the last bit equals zero by assumption.


Now this is the bit I don't understand, I am meant to conclude:

"Thus, since the system$\{1,\sin(nx),\cos(nx)\}_n$ is complete in $L^2[-\pi,\pi]$, we obtain $\overline{f}(x)=0$ in $[-\pi,\pi]$ and hence $f(x) = 0$ in $[0,\pi]$"


Since $\bar{f}$ is essentially odd (except possibly at $x=0$) we have $\int_{-\pi}^\pi \bar{f}(x) \cos(nx) dx = 0$ for all $n$ (including $n=0$).

Hence $\bar{f}$ is orthogonal to $x \mapsto \sin (nx)$, $x \mapsto \cos (nx)$ for all $n$, completeness implies that $\bar{f}(x) = 0$ ae.