In my numerical methods class today, we considered approximating the "tent function" $$ f(x) := \begin{cases} 2x & \text{if } 0 \leq x \leq 1/2 \\[2pt] 2-2x & \text{if } 1/2 \leq x \leq 1/2 \end{cases} $$
by a partial sum of its Fourier series, which we found to be \begin{align*} f(x) = \sum_{n=1}^{\infty} a_n\sin(n\pi x) \end{align*}
where $a_n = \frac{8}{n^2 \pi^2} \sin(\tfrac{1}{2}n\pi)$. Letting $S_N f(x) := \sum_{n=1}^{N}a_n \sin(n\pi x)$ for each $N \geq 1$, my professor then claimed--without proof--that \begin{align*} \|f - S_N f \|_{L^{\infty}([0,1])} = |f(1/2) - S_N f(1/2)|. \end{align*}
This seems plausible as $f'$ is undefined at $x = 1/2$, so it makes some sense intuitively that the Fourier series would be less well-behaved at this point. I also confirmed this graphically by plotting $|f(x) - S_N f(x)|$ for a few different values of $N$. But I would like a more rigorous justification for this. So my question is:
How can we rigorously prove that $\|f - S_N f \|_{L^{\infty}([0,1])} = |f(1/2) - S_N(1/2)|$ ? And more generally, if $f: [a,b] \to \mathbb{R}$ is differentiable (or say, of bounded variation on $[a,b]$) and $f'$ has a finite number of discontinuities, is it true that the maximum of $|f(x) - S_N f(x)|$ on $[a,b]$ must always occur at an $x$ where $f'$ is discontinuous?
It simplifies matters to translate the graph horizontally and vertically so that it becomes $f(x)= (\pi-|x|)$ for $|x|<\pi$. This function is even and has a cosine expansion. A calculation of the Fourier coefficients reveals that $f(x)=a_0+\sum_{k\geq 1} a_{2k+1} \cos ((2k+1) x)$ has the property that all the Fourier coefficients on the right have the same sign (positive). Thus one can see that each term is maximal when the cosine peaks at $x=0$.
The Fourier series converges pointwise to the desired function $f(x)$. This implies the error term is the tail sum of the expansion: $E_N(x)= f(x)- S_N(x)=\sum_{(2k+1)\geq N} a_{2k+1} \cos ((2k+1)x)$.
Since each cosine term peaks at $x=0$, this sum also peaks when $x=0$.
Of course the translation has no effect on the error estimates since the errors are intrinsic geometric properties.
Your broader question is harder to answer precisely. I expect that in the presence of jump discontinuities in the derivative, the error term $E_N$ will have local peaks concentrated near those bad points.As $N\to \infty$, these peaks will concentrate in smaller and smaller intervals about those bad points. This follows from the fact that the function can be expressed as a finite sum of basic building blocks of the general type discussed above, along with a relatively harmless globally smoother function. Because you have some weak interactions from distantly separated bad points, the locations of the peak errors can be shifted slightly. And the globally smoother function will also have some weak influence.
In short, for practical purposes, basically it is correct that for large values of $N$ the error peaks are positioned ever- closer to the bad points.