Solution (source code)

= Solution

Use real-valued <continuous functions> and real <trigonometric polynomials>. The <trigonometric Chebyshev alternation theorem> says that $p\in\mathcal T_n$ is the unique <best uniform approximation> to $f$ if and only if there are distinct points, ordered within one period,
$$
x_0<x_1<\cdots<x_{2n+1}<x_0+2\pi,
\qquad f(x_j)-p(x_j)=\varepsilon(-1)^j\|f-p\|_\infty,
\quad\varepsilon\in\{-1,1\}.
$$
Thus \b[the required number of alternating extrema is $2n+2$]. When the error is zero, the assertion is interpreted trivially and $p=f$ is unique. The count reflects $\dim\mathcal T_n=2n+1$ and the fact that a nonzero degree-$n$ <trigonometric polynomial> has at most $2n$ zeros in one period. In particular a strictly better candidate would force its difference from $p$ to have alternating signs at these points and hence at least $2n+2$ zeros, counting the closing interval around the circle. The <trigonometric Chebyshev alternation theorem> also gives necessity and uniqueness.