Is this function Lipschitz? Let $f:X \rightarrow \mathbb R$ be a Lipschitz function  on a metric space $X$ and $K<M$ be some constants.
Is it such a function $g:X\rightarrow \mathbb R$ Lipschitz: 
$$
g(x)=f(x) \textrm{ if } \ K \leq f(x) \leq M,
$$
$$
g(x)=K \textrm { if } \ f(x)<K,
$$
$$
g(x)=M \textrm{ if } \  f(x)>M.
$$
Thanks

You can write your function as $\min(\max(f(x), K), M)$. Note that the composition of Lipschitz functions is Lipschitz. So you just have to show that the functions $\min(x,K)$ and $\max(x,M)$ are Lipschitz on ${\mathbb R}$, which is not hard.
