# How do we show Lipschitz continuity?

I am working on existence and uniqueness of nonlinear systems and one of the prerequisites is the notion of Lipschitz continuity. I am a little bit confused on how we use the definitions to actually show that a function is Lipschitz continuous or not.

First, I'll provide the definitions that I am aware of:

A function $$f$$ is locally Lipschitz on an open and connected subset $$D\subset\mathbb R^n$$ if each point of $$D$$ has a neighborhood $$D_0$$ such that

$$||f(x)-f(y)||\leq L||x-y||\qquad (1)$$

for all point in $$D_0$$ with some Lipschitz constant $$L_0$$. We say that $$f$$ is globally Lipschitz if $$f$$ satisfies condition $$(1)$$ for all points in a set $$W$$ with the same constant $$L$$.

Now, a simple example is to consider $$f(x)=x^2+|x|$$. One way to determine if $$f$$ is Lipschitz continuous is to write $$f=g+h$$ where $$g(x)=x^2$$ and $$h(x)=|x|$$.

Now $$g$$ is locally Lipschitz, thus continuous, and continuously differentiable but not globally Lipscitz. In a similar manner, $$h$$ is not continuously differentiable, but locally and globally Lipschitz and thus continuous. From these arguments, one may conclude that $$f$$ is not continuously differentiable, but it is locally Lipschitz and continuous.

Why is that? Why are we allowed to argue Lipschitz continuity of $$f$$ by studying the functions $$g,h$$?

Proof: Let $$f$$ and $$g$$ be locally Lipschitz. Choose a point $$z$$. There is a neighborhood $$D_f$$ of $$z$$ such that $$|f(x)-f(y)|\le L_f|x-y|$$ for all $$x,y\in D_f$$, and a neighborhood $$D_g$$ such that $$|g(x)-g(y)|\le L_g|x-y|$$ for all $$x,y\in D_g$$. Then, on the neighborhood $$D_f\cap D_g$$, $$|af(x)-af(y)|\le aL_f|x-y|$$ and $$|(f(x)+g(x))-(f(y)+g(y))|\le (L_f+L_g)|x-y|$$.
This can be done everywhere. Every point has a neighborhood on which $$af$$ and $$f+g$$ are Lipschitz, so the definition holds and $$af$$ and $$f+g$$ are locally Lipschitz. Done.
So then, we can break things down. We wrote $$f=g+h$$, and showed $$g$$ and $$h$$ were locally Lipschitz. By the lemma, $$g+h=f$$ is locally Lipschitz as well.
It's been awhile since I've worked with Lipschitz continuity, but from what I worked out it's a means of employing the triangle inequality and the continuity conditions on functions $$g(x)$$ and $$h(x)$$. Like you asserted in your post. $$g(x) = x^{2}$$ is locally Lipschitz continuous. In other words, $$||g(x)-g(y)|| \leq L_{g} ||x-y||$$ where the value $$L_{g}$$ will vary depending on what $$x$$ and $$y$$ are. And $$h(x) = |x|$$ is globally Lipschitz so $$||h(x) - h(y)|| \leq L_{h} ||x-y||$$ where $$L_{h}$$ is invariant upon your choices of $$x$$ or $$y$$. Now if we put those two together we see that $$||g(x)-g(y)|| \: + \: ||h(x)-h(y)|| \leq (L_{g} + L_{h}) ||x-y||$$ Since $$f(x) = g(x) + h(x)$$ we can see from the triangle inequality that $$||f(x) - f(y)|| = ||g(x) - g(y) + h(x) - h(y)|| \leq ||g(x) - g(y)|| + ||h(x) - h(y)||$$ And thus we can easily see that $$||f(x) - f(y)|| \leq (L_{g} + L_{h}) ||x - y||$$ Thus making it locally but not globally Lipschitz. A similar process can be done to show differentiability everywhere except $$x=0$$.