So I have this function that is defined as follows:
$$f(x)=\begin{cases} \phantom{-}1,&\text{ for }x>0\\ -1,&\text{ for }x<0\\ \phantom{-}\frac{1}{2}&\text{ for } x=0,\pm\frac{L}{2}\end{cases}$$ And then I found the Fourier Series that repreesents this function: $$f(x)=\sum_{k\neq0}\frac{i}{\pi k}\left[1-\cos\pi k\right]e^{\frac{2i\pi kx}{L}}$$ And when I graph it taking $k$ to be super large (I put in like $k=10,000$) it gives me a result that looks like $f(x)$, however I'm supposed to show that somehow that this Fourier Series actually produces this function, and I just have no idea how. When I used Fourier Series to solve a PDE it was pretty straight forward to show that the series solved thee PDE, but I have no idea how to do it for a random function I've been given. Apparently I am supposed to rewrite the series as the contour integral: $$\frac{i}{\pi}\oint_{c_1+c_2}\frac{\pi}{z\sin{z}}\left[1-\cos z \right]e^{\frac{2i z x}{L}}e^{\pm i z}$$ Where $c_1$ is a line parallel to the real axis, but displaced by a small amount above it, from $+\infty$ down to a value between $0$ and $\pi$, e.g. down to $\frac{\pi}{2}$; the contour then makes a small counterclockwise half loop around $\frac{\pi}{2}$ and proceeds back to $+\infty$ along a line parallel to the real axis, but displaced by a small amount $\epsilon$ below it and $c_2$ is the same but going to $-\infty$. But $a)$ I am not sure how to evaluate this contour integral, and $b)$ I fail to see the connection between this contour integral and fourier series and the contour integral.