Solution (source code)

= Solution

First prove necessity. If <polynomials> with <integer> <coefficients> converge to $f$ in the <supremum norm>, their values at $0$ and $1$ are convergent sequences of <integers>. Each such sequence is eventually constant, since a convergent sequence is <Cauchy> and two distinct <integers> are at distance at least one. Its limit is an <integer>. Thus $f(0),f(1)\in\mathbb Z$.

For sufficiency we also need <uniform convergence> of the <Bernstein polynomial> to $f$. Here is a direct argument. For $X\sim\operatorname{Bin}(n,x)$, write $B_n(f,x)=\mathbb E f(X/n)$. The <binomial distribution> has $\mathbb E(X/n)=x$ and $\operatorname{Var}(X/n)=x(1-x)/n\le1/(4n)$. For every $\delta>0$, <uniform continuity> of $f$ and the <Chebyshev inequality> give
$$
|B_n(f,x)-f(x)|\le\omega(f,\delta)+2\|f\|_\infty\mathbb P(|X/n-x|>\delta)
\le\omega(f,\delta)+\frac{\|f\|_\infty}{2n\delta^2}.
$$
First make $\delta$ small and then $n$ large; the bound is uniform in $x$. Hence $\|B_n(f)-f\|_\infty\to0$.

If the endpoints are <integers>, part (b) gives $\|B_n^*(f)-B_n(f)\|_\infty\to0$. Each coefficient multiplying $x^k(1-x)^{n-k}$ in $B_n^*$ is an <integer>. Expanding $(1-x)^{n-k}$ by the <binomial theorem> therefore gives <integer> <coefficients> in the ordinary monomial <basis>. The <triangle inequality> proves $\|B_n^*(f)-f\|_\infty\to0$. Thus \b[the <integer> endpoint condition is necessary and sufficient] for <integer-coefficient polynomial approximation>.