TITLE: Lipschitz-continuous $f(x)=x^2\cdot \sin\left(\frac{1}{x}\right)$
QUESTION [6 upvotes]: How to prove that $f$ is globally
Lipschitz-continuous $$ f:\mathbb{R}\longrightarrow \mathbb{R}$$ 
$$ f(x) = \left\{ 
  \begin{array}{c l}
    x^2\cdot \sin\left(\frac{1}{x}\right) & ,\quad x\neq0\\
    0 & ,\quad x=0
  \end{array} \right.$$
Any hints would be appreciated.

REPLY [10 votes]: Notice that
$$
f'(x)=\begin{cases}
2x\sin\frac1x-\cos\frac1x &\text{ if } x\ne0\\
0 &\text{ if } x=0
\end{cases}.
$$
Therefore
$$
|f'(x)|\le 2|x|\cdot\left|\sin\frac1x\right|+\left|\cos\frac1x\right|\le 3 \quad \forall x\ne 0.
$$
Hence,
$$
|f'(x)|\le 3 \quad \forall x \in \mathbb{R}.
$$
It follows that 
$$
|f(x)-f(y)|\le \sup_{\min\{x,y\} \le z\le \max\{x,y\}}|f'(z)||x-y|\le 3|x-y| \quad \forall x,y \in \mathbb{R}.
$$