# Locally Lipschitz implies Lipschitz

Let $U$ be a convex open set in $\mathbb{R}^n$ and $f:U\longrightarrow \mathbb{R}$ such that there is $M>0$ with the following property:

$\forall x\in U , \exists r >0: \forall a,b \in B(x,r),|f(a)-f(b)|\le M\cdot ||a-b||$ then it holds that

$\forall x,y\in U,|f(x)-f(y)|\le M\cdot ||x-y||.$

-

Hint: For any pair $x,y\in U$ cover the compact set $\{ty+(1-t)x: t\in [0,1]\}\subset U$ with finitely many open balls $B_1,\ldots,B_n$ such that $f$ is Lipschitz on each $B_i$. Let $$X=\{t: t\in \text{ more than one } B_i\}$$ which is a finite union of intervals, and let $\epsilon$ be the sum of their lengths. Note that $\epsilon$ can be made arbitrarily small. Apply the triangle inequality, and let $\epsilon\to 0$.
Remark: This actually works for any path-connected $U$, by replacing the set $\{ty+(1-t)x: t\in [0,1]\}$ with $\{p(t):t\in [0,1]\}$ for some path $p$ connecting $x$ and $y$.
Locally Lipschitz functions are not (globally Lipschitz) if we agree that a function $f:X \to Y$ is locally Lipschitz provided any $x \in X$ admits a neighbourhood $U_x$ such that its restriction $f|U_x$ is (globally) Lipschitz (see, e.g. http://en.wikipedia.org/wiki/Lipschitz_continuity). In that case the Lipschitz constant of $f|U_x$ does depend on $x$, which is not the case in the definition you gave. With the usual definition of "locally Lipschitz" one can show that any differentiable function $f:(a,b)\to \mathbb{R}$ for which $f'$ is unbounded on $(a,b)$ and bounded on compact subsets of $(a,b)$ is locally Lipschitz but not (globally) Lipschitz. Functions satisfying the property you mention are more than just locally Lipschitz. For instance a $C^1$ function $f:(a,b) \to \mathbb{R}$ satisfies "your property" iff $\sup_{a<x<b}|f'(x)| \le M$.