Solution (source code)

= Solution

Away from zero and the zeros of $\cos(\pi/x)$, the <sign function> is locally constant and the <absolute value function> is differentiable at the value of the cosine. The <product rule> and <chain rule> give
$$
\begin{aligned}
f'(x)
&=2x\operatorname{sign}(x)\left|\cos\frac\pi x\right|
+x^2\operatorname{sign}(x)\operatorname{sign}\left(\cos\frac\pi x\right)
\frac\pi{x^2}\sin\frac\pi x\\
&=2|x|\left|\cos\frac\pi x\right|
+\pi\operatorname{sign}(x)\operatorname{sign}\left(\cos\frac\pi x\right)
\sin\frac\pi x.
\end{aligned}
$$
Thus the <triangle inequality> and the bounds on <sine> and <cosine> imply $|f'(x)|\leq2|x|+\pi$. Part (c) rules out differentiability at every nonzero cosine zero, and part (b) gives $f'(0)=0$, so this estimate covers every point where the <derivative> exists.

For a finite interval $I$, choose $L<\infty$ such that $|x|\leq L$ throughout $I$. Then
$$
\boxed{|f'(x)|\leq C_I:=2L+\pi\quad(x\in I\text{ where }f'(x)\text{ exists}).}
$$
The apparent $x^{-2}$ factor in the derivative of the oscillation cancels against the multiplying $x^2$, which is what makes a uniform bound possible even near zero.