Let's say we have a piecewise $C^1$, $2\pi$ periodic, piecewise Lipschitz continuous function $f$, that is, we can find $0=t_0<...<t_l=2\pi$ such that $f|(t_{j-1},t_{j})$ is Lipschitz continuous and $C^1$ for all $j=1,...,l$ and let $g = f'$ on $(t_0,t_1)\cup...\cup(t_{l-1},t_l)$. We denote $c_k, \gamma_k$ as the Fourier coefficients for $f$ and $g$ respectively. (then we know that the Fourier series for $f$ and $g$ converges to the function $f$ and $g$ respectively, Fourier's convergence theorem)
Now we can show using partial integration (by splitting up the intervals) that $c_k = -\frac{i}{k} \gamma_k$.
For a concrete example lets consider a function $f$ that takes on the value $1$ on $(0,\pi)$ and $-1$ on $(\pi,2\pi)$, additionally $f(0)=f(\pi)=0$
We can then take $g$ as the contant zero function, but then we have $\gamma_k = 0$ for all $k$, whereas we know that $c_k$ is not just all zeroes.
What's wrong here?
Here's my attempt to proof that $c_k = -\frac{i}{k} \gamma_k$:
$c_k = \frac{1}{2\pi} \int_{0}^{2\pi} e^{-ikx}f(x) \,dx = \frac{1}{2\pi}\sum_{j=1}^{l} \int_{t_{j-1}}^{t_j} (cos(kx)-isin(kx))f(x) \,dx = \frac{1}{2\pi}\sum_{j=1}^{l}[\frac{1}{k}sin(kx)f(x)\Big|_{t_{j-1}}^{t_j} - \int_{t_{j-1}}^{t_j} \frac{1}{k}sin(kx)g(x) \,dx] + \frac{i}{2\pi}\sum_{j=1}^{l}[\frac{1}{k}cos(kx)f(x)\Big|_{t_{j-1}}^{t_j} - \int_{t_{j-1}}^{t_j} \frac{1}{k}cos(kx)g(x) \,dx] = \frac{1}{2\pi k}[sin(k2\pi)f(2\pi)-sin(0)f(0)] - \frac{1}{2\pi k} \int_{0}^{2\pi} sin(kx)g(x) \,dx + \frac{i}{2\pi k} * 0 -\frac{i}{2\pi k} \int_{0}^{2\pi} cos(kx)g(x) \,dx = -\frac{i}{k}\gamma_k$