Solution (source code)

= Solution
{c}

Using the usual piecewise smooth interpretation of the derivative hypothesis, <Dirichlet's theorem on Fourier series> gives the average of the two one-sided limits of the appropriate <periodic extension>. The <even extension> is continuous at $0$ and at the identified endpoints $\pm\pi$, so the <Fourier cosine series> converges to
$$
\boxed{f(x)\quad\text{for every }0\leq x\leq\pi.}
$$
For the <odd extension>, the one-sided limits at zero are $-f(0)$ and $f(0)$, while at $\pi$ the periodic one-sided limits are $f(\pi)$ and $-f(\pi)$. Hence the <Fourier sine series> converges to
$$
\boxed{\begin{cases}f(x),&0<x<\pi,\\0,&x=0\text{ or }x=\pi.\end{cases}}
$$
At an endpoint this equals $f$ precisely when $f$ is zero there. One can also see the zero endpoint values directly: every <partial sum> consists of <sines> that vanish at both endpoints.