Stone-Weierstrass for monotone functions Let $\; f : [0,1] \to \mathbb{R} \;$ be continuous and non-decreasing. $\;\;$ Let $\epsilon$ be a real number such that $\; 0 < \epsilon \;$.

Does it follow that that there exists a real polynomial $p$ such that $p$ is non-decreasing on


*

*$\;$ $[0,1]$


*$\;$ all of $\mathbb{R}$


and for all members $x$ of $[0,1]$, $\; |f(x)+(-(p(x)))| < \epsilon \;\;$?
 A: In fact this question is a simple prototype of a serious problem of approximation maintaining additional qualitative properties of a function, with precise error estimates. See 
http://mathworld.wolfram.com/ComonotoneApproximation.html 
for the case of piecewise monotone functions. There are many problems and results of this kind (for example, with convex functions), which are useful in engineering applications and are far from trivial.  
A: In fact, the Bernstein polynomials approximating $f$ are non-decreasing on $[0,1]$.  A cute way to see this is via coupling (I learned this from Lindvall's book Lectures on the Coupling Method):
The $n$th Bernstein polynomial $p_n(x)$ can be written as $\mathbf{E}\Big[f\big(\frac{\sum_{i=1}^n Z^x_i}{n}\big)\Big]$, where $Z^x_i$ are Bernoulli random variables with parameter $x$.  If $0\leq x\leq y\leq 1$, then we can define the variables $Z^x_i$ and $Z^y_i$ on the same probability space, such that $Z^x_i\leq Z^y_i$, which immediately gives $p_n(x)\leq p_n(y)$.
