I want to derive the following formula for $\zeta(2k)$: $$ \zeta(2k) = (-1)^{k - 1} 2^{2k - 1} \frac{B_{2k}}{(2k)!} \cdot \pi^{2k} $$ My approach was as follows: define $f(z) = 1/z^{2k}$, which is an even meromorphic function without poles or zeroes at the non-zero integers. Then I show that for every meromorphic function $f$ without poles or zeroes at the non-zero integers and for every non-zero integer $k$, the function $$ g(z) = \frac{2 \pi i f(z)}{e^{2 \pi i z} - 1} $$ has residue $f(k)$ at $z = k$. Hence by the Residue theorem, we obtain $$ \oint_{S_N} \frac{2\pi i f(z)}{e^{2 \pi i z} - 1} ~\text{d}z = 2\pi i \sum_{k = -N, ~ k \neq 0}^N f(k) = 4 \pi i \sum_{j = 1}^N f(j) $$ since $f$ was even. Here, $S_N$ is the square through the points $\pm (N + 1/2) \pm i (N + 1/2)$. Taking the limit of $N$ to infinity, we obtain $$ 4 \pi i \cdot \zeta(2k) = \lim_{N \to \infty} \oint_{S_N} \frac{2\pi i f(z)}{e^{2 \pi i z} - 1} ~ \text{d}z $$ However, this is where things get weird. My teacher told me to use two things: (1) the fact that this limit is zero, and (2) the fact that the Bernoulli numbers are given by the formula $$ \frac{z}{e^z - 1} = \sum_{n = 0}^{\infty} \frac{B_n}{n!} z^n $$ for $|z| < 2 \pi$. I flat out ignored (1) (because this would mean $\zeta(2k) = 0$, which we know isn't true), but using (2) would yield $$ 4 \pi i \cdot \zeta(2k) = \lim_{N \to \infty} \oint_{S_N} \frac{f(z)}{z} \frac{2 \pi i z}{e^{2 \pi i z} - 1} ~\text{d}z = \lim_{N \to \infty} \oint_{S_N} \sum_{n = 0}^{\infty} \frac{f(z)}{z} \frac{B_n}{n!} (2 \pi)^n i^n z^n $$ But technically, I can't use (2), since $|2 \pi i z| = |2 \pi| \cdot |z|$ but $|z|$ can be bigger than 1 since we integrate over $S_N$. So in order to use (2), I probably have to use (1). But how?
Now if I just ignore the requirement $|2 \pi i z| < 2 \pi$, I arrive at $$ 4 \pi i \cdot \zeta(2k) = \lim_{N \to \infty} \oint_{S_N} \sum_{n = 0}^{\infty} \frac{B_n}{n!} (2 \pi)^n i^n z^{n - 2k - 1} ~\text{d}z $$ Now I "know" I only have to consider $n = 2k$, because otherwise, the power $p$ in $z^p$ is different from $-1$, and then the line integral will be zero anyway (because $S_N$ is closed). However, I cannot justify interchanging the integral and the (infinite!) series. How can I do so? Because then, I arrive at $$ 4 \pi i \cdot \zeta(2k) = \lim_{N \to \infty} \frac{B_{2k}}{(2k)!} (2 \pi)^{2k} i^{2k} \oint_{S_N} \frac{1}{z} ~\text{d}z = \lim_{N \to \infty} (-1)^k \frac{B_{2k}}{(2k)!} 2^{2k} \pi^{2k} \cdot 2 \pi i $$ which can then be written as $$ \zeta(2k) = (-1)^k \frac{B_{2k}}{(2k)!} 2^{2k - 1} \pi^{2k} $$ which is almost what I wanted to show (the power of $-1$ should be $k - 1$ instead of $k$, but this is probably just some small error somewhere).
Any help is greatly appreciated.
NOTE: I am not looking for just any derivation of the formula for $\zeta(2k)$, since that can be found online. I am looking to derive the formula in this way, and in particular to understand why you have to show that the limit does indeed equal zero.
After the line "Hence by the residue theorem" you forgot the residue at $0$. So you should get $$4\pi i \zeta(2k) + 2\pi i \mathrm{Res}_{z = 0} g(z) = \lim_{N \to \infty} \oint_{S_n} g(z)\,dz.$$
Your teacher was right; you want to show that this limit is zero, and then you want to calculate the residue at $0$: I won't go through all the details, but the idea is: \begin{align*} \mathrm{Res}_{z = 0}g(z) &= [z^{-1}] \frac{2\pi i }{z^{2k} (e^{2\pi i z} - 1)} \\ &=2\pi i [z^{2k}] \frac{z}{e^{2\pi i z} - 1} \end{align*} where $[z^a]$ denotes the coefficient of $z^a$ in the Laurent series. You can find this explicitly in terms of the Bernoulli numbers now, and when the dust settles you'll get your formula.