It's a known proof, but here's what I've got so far. Let $f \in L^2_\mathbb{C}[-\pi,\pi]$, with $f(x)=x$, and take $e_n(x) = e^{inx}/\sqrt{2\pi}, n \in \mathbb{Z}$ which is an orthonormal sequence in the Hilbert space $L^2_\mathbb{C}[-\pi,\pi]$. Note that the inproduct is defined as $(f,g) = \int^\pi_{-\pi}f\overline{g}\,dx$.
Then by Parseval's theorem we have that: $ \lVert x \rVert^2 = \sum_{n=1}^\infty|(x,e_n)|^2$ for all $x \in L^2_\mathbb{C}[-\pi,\pi]$. We have that $ \lVert x \rVert^2 = \int^\pi_{-\pi}x^2 \, dx = \frac{2}{3}\pi^3$. Then calculating:
\begin{align*} (x,e_n) &= \frac{1}{\sqrt{2\pi}}\int^\pi_{-\pi}xe^{-inx}\,dx \\ &= \frac{1}{\sqrt{2\pi}}\left(\frac{ix}{n}e^{-inx} \right)_{x \in [-\pi,\pi]} \\ &= \frac{1}{\sqrt{2\pi}} \frac{2\pi i}{n}e^{-in\pi} = \frac{\sqrt{2\pi}i}{n}e^{in\pi} \end{align*} This means that $|(x,e_n)|^2 = \frac{2\pi}{n^2}$, so from the first equality we now have: \begin{align*} \lVert x \rVert^2 &= \sum_{n=1}^\infty|(x,e_n)|^2 \\ \frac{2}{3}\pi^3 &= 2\pi\sum_{n=1}^\infty \frac{1}{n^2} \\ \frac{\pi^2}{3} &= \sum_{n=1}^\infty \frac{1}{n^2}. \end{align*}
This is obviously wrong, but I'm trying to pinpoint where. I feel it has something to do with my books form of Parseval's theorem, which takes the sum from 1 to $\infty$, and not $-\infty$ to $\infty$, which causes the missing factor of 2. Can't see how this would remedied by anything. Any ideas?