Proving $\sum_{k = 1}^{\infty} k^{-2} = \pi^2 / 6$ using Fourier analysis I'm doing a homework for my analysis class, and a problem says the following:

Let $f : \mathbb{T}^1 \to \mathbb{C}$ be the function
  $$f(\theta) = \begin{cases} 1 & 0 < \theta < \pi \\ 0 & - \pi < \theta < 0 \end{cases}$$
  Compute the Fourier transform of $f$. Finally, it says to use the fact that the Fourier transform is an isometry from $L^2 \left( \mathbb{T}^1 \right) \to \ell^2$ to show that $\sum_{k = 1}^{\infty} k^{-2} = \pi^2 / 6$.

I've computed the Fourier transforms of $f$ as
$$\hat{f}(k) = \begin{cases}
\frac{1}{2} & k = 0 \\
0 & \textrm{$k \neq 0$ even} \\
- \frac{i}{\pi k} & \textrm{$k$ odd}
\end{cases}$$
If I understand correctly, what it wants me to do next is observe that since $f \mapsto \hat{f}$ is a unitary operator from $L^2 \left( \mathbb{T}^1 \right)$ to $\ell^2$, we have
$$\pi = \| f \|_{L^2}^2 = \sum_{k \in \mathbb{Z}} \left| \hat{f}(k) \right|^2 = \frac{1}{4} + \frac{1}{\pi^2} \sum_{\textrm{$k$ odd}} \frac{1}{k^2}$$
Now there's an example in the text that does something with a different function to get that $\sum_{\textrm{$k \geq 1$} odd} k^{-2} = \frac{\pi^2}{8}$, then does some arithmetic trickery to get that $\sum_{k = 1}^{\infty} k^{-2} = \frac{\pi^2}{6}$. But whenever I do this calculation on the $f$ shown above, I get different numbers. I've already sunk a lot of time into this. Do I have an arithmetic error somewhere that I need to iron out, or am I on the wrong track?
Thanks.
EDIT: In this text, the Fourier transform is defined as $$\hat{f}(k) = (2 \pi)^{-1} \int_{- \pi}^{\pi} f(\theta) e^{-k i \theta} \mathrm{d} \theta$$
 A: Thank you to @GReyes for his help. He pointed out that the correct formula for $\| \cdot \|_{L^2}$ should've been
$$\| f \|_{L^2} = (2 \pi)^{-1} \int_{- \pi}^{\pi} |f(\theta)|^2 \mathrm{d} \theta .$$
With this fix, the solution to the problem is as follows:
\begin{align*}
\hat{f}(k) & = (2 \pi)^{-1} \int_{- \pi}^{ \pi} f(\theta) e^{- i k \theta} \mathrm{d} \theta \\
 & = (2 \pi)^{-1} \int_{0}^{\pi} e^{- i k \theta} \mathrm{d} \theta .
\end{align*}
If $k = 0$, then $e^{- i k \theta} = 1$ for all $\theta$, so we know that $\hat{f}(0) = \frac{1}{2}$. But if $k \neq 0$, then
\begin{align*}
\hat{f}(k) & = (2 \pi)^{-1} \int_{0}^{\pi} e^{- i k \theta} \mathrm{d} \theta \\
 & = (2 \pi)^{-1} \left[ \frac{e^{- i k \theta}}{- i k} \right]_{\theta = 0}^{\pi} \\
 & = (2 \pi)^{-1} \frac{1}{- i k} \left( e^{- i k \pi} - 1 \right) \\
 & = \frac{i}{2 \pi k} \left( (-1)^{k} - 1 \right) \\
 & = \begin{cases}
 0 & \textrm{$k \neq 0$ even} \\
 - \frac{i}{\pi k} & \textrm{$k$ odd}
 \end{cases}
\end{align*}
In summary,
$$\hat{f}(k) = \begin{cases}
\frac{1}{2} & k = 0 \\
0 & \textrm{$k \neq 0$ even} \\
- \frac{i}{\pi k} & \textrm{$k$ odd}
\end{cases}$$
Now we use Parseval's theorem. We can see that $\| f \|_{L^2}^2 =  (2 \pi)^{-1} \int_{- \pi}^{\pi} |f(\theta)|^2 \mathrm{d} \theta = \frac{1}{2}$. Now we're going to use the fact that $\| f \|_{L^2}^2 = \sum_{k \in \mathbb{Z}} \left| \hat{f}(k) \right|^2$ to find $\sum_{k = 1}^{\infty} k^{-2}$. Note that if we can show that $\sum_{\textrm{$k \geq 1$ odd}} k^{-2} = \pi^2 / 8$, the remainder of the proof will follow from the text's argument (see (5.4.21), page 194).
By Parseval's theorem, we have that
\begin{align*}
\| f \|_{L^2}^2 & = \sum_{k \in \mathbb{Z}} \left| \hat{f}(k) \right|^2 \\
= \frac{1}{2} & = \frac{1}{4} + \sum_{\textrm{$k \in \mathbb{Z}$ odd}} \frac{1}{\pi^2 k^2} \\
 & = \frac{1}{4} + \frac{2}{\pi^2} \sum_{\textrm{$k \geq 1$ odd}} k^{-2} \\
\Rightarrow \frac{1}{4} & = \frac{2}{\pi^2} \sum_{\textrm{$k \geq 1$ odd}} k^{-2} \\
\Rightarrow \frac{\pi^2}{8} & = \sum_{\textrm{$k \geq 1$ odd}} k^{-2} .
\end{align*}
Finally, following the text's lead, we observe that
\begin{align*}
\sum_{k = 1}^{\infty} k^{-2} & = \sum_{\textrm{$k \geq 1$ odd}} k^{-2} + \sum_{\textrm{$k \geq 1$ even}} k^{-2} \\
 & = \sum_{\textrm{$k \geq 1$ odd}} k^{-2} + \sum_{\ell = 1}^{\infty} (2 \ell)^{-2} \\
 & = \sum_{\textrm{$k \geq 1$ odd}} k^{-2} + \frac{1}{4} \sum_{\ell = 1}^{\infty} \ell^{-2} \\
\Rightarrow \frac{3}{4} \sum_{k = 1}^{\infty} k^{-2} & = \sum_{\textrm{$k \geq 1$ odd}} k^{-2} \\
 & = \frac{\pi^2}{8} \\
\Rightarrow \sum_{k = 1}^{\infty} k^{-2} & = \frac{4}{3} \frac{\pi^2}{8} \\
 & = \frac{\pi^2}{6} .
\end{align*}
