Example
Prove that \(f(x) = x^2\) is uniformly continuous on \([0,M]\) where \(M < \infty\). However, it is not uniformly continuous on \(\mathbb{R}\)

Proof

Let \(\epsilon > 0\) and take \(\delta = \frac{\epsilon}{2M}\). Then

$$ \begin{align*} |f(x) - f(y)| &= |x^2 - y^2| \\ &= |x+y||x-y| \\ &\leq (|x|+|y|)|x-y| \quad \text{(triangle inequality)} \\ &< 2M \frac{\epsilon}{2M} = \epsilon \end{align*} $$

This shows that \(f(x)=x^2\) is uniformly continuous on \([0,M]\). Next, we show that it’s not uniformly continuous on \(\mathbb{R}\) by negating the definition of uniform continuity.

There exists an \(\epsilon_0 > 0\) such that for all \(\delta > 0\), there exists \(x, y \in \mathbb{R}\) such that \(|x - y| < \delta\) but \(|f(x) - f(y)| \geq \epsilon_0\)

So for each \(\delta\), we need to find just a pair of points where they are close to each other (ie \(|x - y| < \delta\) but \(|f(x) - f(y) \geq \epsilon_0\)

So now take \(\epsilon_0 = 1\). Then, for any \(\delta > 0\), by the Archimedean principle choose

$$ \begin{align*} n > \frac{1}{\delta} \end{align*} $$

and let \(x = n + \frac{\delta}{2}\) and \(y = n\). Then observe that

$$ \begin{align*} |f(x) - f(y)| &= \left| \left(n+ \frac{\delta}{2} \right)^2 - n^2 \right| \\ &= \left| n^2 + \delta n + \frac{\delta^2}{4} - n^2 \right| \\ &= \left| \delta n + \frac{\delta^2}{4} \right| \\ &= \delta n + \frac{\delta^2}{4} \\ &\geq \delta n \\ &\geq \delta \frac{1}{\delta} = 1. \ \blacksquare \end{align*} $$

References