Approximate continuous bounded function by Lipschitz functions Let $X$ be a metric space. Let $f:X\to\Bbb{R}$ be continuous and bounded. Can we approximate $f$ by Lipschitz functions (pointwise, uniformly)?
Are there any properties that we have to assume for $X$, for example being complete?
 A: Yes, there's a way I remember my professor used to demonstrate the Peano's theorem for existence of solutions of ODEs. 
Firstly in $\mathbb{R}$. Fix $x,b\in \mathbb{R}$, an interval $I=[x-b,x+b]$ and let $g$ be a global extension of $f$ in the form 


*

*$g(x)=f(y)$, if $y\in I$;

*$g(x)=f(x+b)$, if $y\geq x+b$;

*$g(x)=f(x-b)$, if $y\leq x-b$.
Then :


*

*$f_\varepsilon
    (y):=\frac{1}{2\varepsilon}\int_{-\varepsilon}^{\varepsilon} g(y+s)
    ds$ is $M/\varepsilon$-Lipschitz in $I$, for every $\varepsilon>0$, where $M=\sup\mid f\mid$; 

*$\sup\mid f_\varepsilon\mid<\sup\mid f\mid$, in $I$;

*$\lim_{\varepsilon\rightarrow 0} f_\varepsilon=f$.
This approximation by Lipschits functions defining a "plane extension" of $f$ off the boundary and then integrating it in a region dividing by its area is also valid in $\mathbb{R}^n$, for instance
$$f_\varepsilon(y):=\frac{1}{\omega_\varepsilon}\int_{B(x,\varepsilon)} g(y+\textbf{s}) d\textbf{s}$$
is a Lipschitz approximation for $f$, where $\omega_\varepsilon$ is the area of $R=B(x,\varepsilon)$ and $g$ is a continuous function that coincides with $f$ in $R$ and carries the value of the border elsewhere.
Maybe the Weierstrass approximation theorem using Bernstein polynomials might be useful as well.
