An example of a function uniformly continuous on $\mathbb{R}$ but not Lipschitz continuous

Solution 1:

There are many examples. Here are two of them and a simple method to produce many more:

  • $f(x) = \sqrt{|x|}$
  • $g(x) = |x|\sin{\frac{1}{|x|}}$, where $g(0) = 0$ is understood
  • If $f:[0,\frac{1}{2}] \to \mathbb{R}$ is a continuous function, define $\phi_f:[0,1] \to \mathbb{R}$ $$\phi_f(x) = \begin{cases} f(x), & \text{ if } 0 \leq x \leq \frac{1}{2}, \\ f(1-x), & \text{ if } \frac{1}{2} \leq x \leq 1.\end{cases}$$ Note that the graph of $\phi_f$ is simply the reflection of the graph of $f$ at the vertical line $x = \frac{1}{2}$. Then $\phi_f$ is continuous, satisfies $\phi_f(0)= \phi_f(1)$ and can thus be extended to a continuous periodic function by setting $\varphi_{f}(x) = \phi_f(x-\lfloor x \rfloor)$ for $x \in \mathbb{R}$. The function $\varphi_f$
    • is uniformly continuous
    • coincides with $f$ on $[0,\frac{1}{2}]$
    • is not Lipschitz continuous if $f$ fails to be Lipschitz continuous.

Five key observations to prove the above claims and an aside:

$1$. A continuous function on a compact interval is uniformly continuous, see the Wikipedia page on the Heine-Cantor theorem.

$2$. If $f:(a,b) \to \mathbb{R}$ has the property that $f$ is continuous at $c \in (a,b)$ and if $f$ is uniformly continuous on both intervals $(a,c)$ and $(c,b)$, respectively, then $f$ is uniformly continuous on all of $(a,b)$.

$3$. If $f:(a,b) \to \mathbb{R}$ is differentiable and $f'$ is bounded then $f$ is Lipschitz continuous. This follows from the mean value theorem: if $|f'(\xi)| \leq L$ for all $\xi \in (a,b)$ then $|f(x)-f(y)| \leq |f'(\xi)|\,|x-y| \leq L|x-y|$ for all $x,y \in (a,b)$.

$4$. If $f$ is Lipschitz continuous and differentiable at $x$ then $f'(x)$ is bounded by the Lipschitz constant: $$|f'(x)| = \lim_{h \to 0} \frac{|f(x+h)-f(x)|}{|h|} \leq \frac{L|x+h-x|}{|h|} = L.$$ $5$. Finally, a Lipschitz continuous function is differentiable almost everywhere — that's not easy: it's a consequence of Lebesgue's differentiation theorem and has a beautiful generalization as Rademacher's theorem.


Edit: Why are $f(x) = \sqrt{|x|}$ and $g(x)=|x|\sin{\frac{1}{|x|}}$ uniformly continuous on all of $\mathbb{R}$?

Let $C \gt 0$. By $1$. above both $f$ and $g$ are uniformly continuous on $[-C,C]$ since $[-C,C]$ is compact. On $[C,\infty)$ and $(-\infty,-C]$ both $f$ and $g$ have a bounded derivative, hence they are uniformly continuous there by $3$. above. Now apply $2$. to the intervals $(-C,C)$ and $(C,\infty)$ to see that $f$ and $g$ are uniformly continuous on $(-C,\infty)$ and apply it again to $(-\infty,-C)$ and $(-C,\infty)$ to see that they are uniformly continuous on all of $\mathbb{R}$.