Help establishing a bound on the Fourier coefficients of a bounded $2\pi$ periodic function that is discontinous at the end points? This is from a practice midterm, and I'm having trouble with the first part. Suppose $f$ is a $2\pi$-periodic function that is continuous and differentiable on the interval $[-\pi, \pi]$, but has jump discontinuities at $-\pi$ and $\pi$. Also, suppose there exists a positive constant $M$ such that both $|f(x)|,|f'(x)| \le M$ for all $x \in (-\pi, \pi)$.
(i) Establish the bound
$$
|\hat{f}(n)| \le \frac{2M}{|n|}, \text{ if  }n\ne0
$$
(ii) Show that $\sum |\hat{f}(n)|$ does not converge absolutely.  
Once we have (i), part (ii) is immediate (apparently not. However, a simple proof by contradiction tells that $f$ must be continuous everywhere, but of course it is not at $\pm \pi$, so the series must diverge).
 I'm not sure how to get that bound. If $n\ne 0$, I'm trying to just do
$$
\hat{f}(n) = \frac{1}{2\pi}\int_{-\pi}^{\pi} f(x)e^{-inx}dx \le \frac{M}{2\pi in}(e^{in\pi}-e^{-in\pi}) = \frac{M}{\pi n}\sin(n\pi) =0
$$
which, I mean, I guess is less than the desire bound, but I've obviously done something incorrectly.
I feel like this should be really straight forward, but, essentially, I'm not sure how to rectify the facts that:
1. I didn't take into account that $f$ is discontinuous at the end points.
2. $f$ and $f'$ are only bounded on the open interval and not necessarily the closed one.
3. In fact, I didn't even use the derivative of $f$ at all.  
Any help would be appreciated. 
 A: So I was able to locate the solution to the problem. There, though, there was a very helpful hint given that would have saved me some trouble. It was to "integrate by parts." At that point, it becomes clear: if you let $f_1$ be the left limit of $f$ at $\pi$ and $f_2$ be the right limit at $-\pi$, then because approaching $\pi$ from the left means we use values strictly less than $\pi$ and approaching $-\pi$ from the right uses values strictly greater than $-\pi$ which puts us in the open interval, we can apply the bound to the $f_i$s (I'll have to remember that approach). The other integral obtained when we integrate by parts will contain $f'$ in the integrand which we bound by $M$ because we just need to be differentiable on the open interval; the various constants obtained by integrating combined with $M$ gives us the desired bound above.
A: Given $f$ as described, for $n \ne 0$,
\begin{align}
     \int_{-\pi}^{\pi}e^{-inx}f(x)dx
   &  = \left.\frac{e^{-inx}}{-in}f(x)\right|_{x=-\pi}^{\pi}+\frac{1}{in}\int_{-\pi}^{\pi}f'(x)e^{-inx}dx \\
   & = (-1)^{n}\frac{f(\pi)-f(-\pi)}{-in}+\frac{1}{in}\int_{-\pi}^{\pi}f'(x)e^{-inx}dx.
\end{align}
Because $f$ and $f'$ are bounded by $M$ on $[-\pi,\pi]$, then
$$
     \left|\int_{-\pi}^{\pi}e^{-inx}f(x)dx\right| \le \frac{2M}{|n|}+\frac{1}{|n|}(2\pi M) = \frac{2M(1+\pi)}{|n|}.
$$
If $\sum_{n}|\hat{f}(n)| < \infty$, then
$$
                      \sum_{n=-\infty}^{\infty}\hat{f}(n)e^{inx}
$$
converges uniformly for all $x\in\mathcal{R}$, which then forces the limit to be continuous on all of $\mathbb{R}$ and, hence, $f$ must be periodic because the Fourier series converges to $f$ everywhere on $(-\pi,\pi)$.
