# Constant extension of locally Lipschitz function outside an interval is Lipschitz?

Let $f$ be a locally Lipschitz $C^1$ function defined on $\mathbb{R}$. Define $$g_n(x)=\begin{cases}f(x) &: x \in [-n,n]\\ f(n) &: x \in (n, \infty)\\ f(-n) &:x \in (-\infty, -n)\end{cases}$$.

Then $g_n$ pointwise converges to $g$.

Is $g$ globally Lipschitz? I believe it is, except it is not differentiable at the points $-n$ and $n$. So it is differentiable a.e.

• Yes it is. Determine the Lpischitz constant inside $[-n,n]$. It is easy to check that the same constant holds on $(-\infty,\infty)$. – Quickbeam2k1 Apr 7 '14 at 9:50

You don't need to invoke derivatives, actually. Just write $g_n=f\circ h_n$ where $$h_n(x) = \max(-n,\min(n,x))$$ Check that $h_n$ is a $1$-Lipschitz function (taking maximum of minimum of Lipschitz functions does not increase the Lipschtiz constant.) The Lipschitz constant is submultiplicative under composition.
Suppose $K$ is a convex closed subset of $\mathbb R^n$ and $f:K\to \mathbb R$ is an $L$-Lipschitz function. Extend $f$ to $\mathbb R^n$ by $f(x)=f(a)$ where $a$ is the point of $K$ nearest to $x$. Then the extended map is also $L$-Lipschitz.
Proof: let $\pi:\mathbb R^n\to K$ be the nearest point contraction, i.e., $\pi(x)=a$ in the above notation. This map is $1$-Lipschitz (see second half of the answer). Therefore, $f\circ \pi$ is $L$-Lipschitz, and this is our extension. $\quad \Box$.