# Continuity and uniform continuity

I'm having trouble understanding the notion of uniform continuity, the definition states as follows: Let $f: D\to\mathbb{R}$, $f$ is uniformly continous in $X\subset D$ if: $$\forall\varepsilon >0, \exists\delta >0:\left ( \forall x_1, x_2\in X, |x_1 - x_2|<\delta\Rightarrow |f(x_1)-f(x_2)|<\varepsilon\right )$$

In other words, if a function is uniformly continous in $X$ then it is continous in $X$, but the contrary might not always be true.
As an example, consider $f(x) = x^2$. Fix $\varepsilon =1$, then we can consider $$x_1 =\frac{1}{\delta}, x_2 = \frac{1}{\delta} + \frac{\delta}{2}\Rightarrow |x_1-x_2 |= \frac{\delta}{2}<\delta\Rightarrow |x^2_1 - x^2_2| > 1$$

But now Cantor's theorem on uniform continuity states that if $f$ is continous in a closed interval $[a,b]$, then it is also uniformly continous in $[a,b]$.

Did we not just provide an example of a closed interval $[\frac{1}{\delta}, \frac{1}{\delta}+\frac{\delta}{2}]$ where uniform continuity is not satisfied?

Did we not just provide an example of a closed interval $[1/δ,1/δ+δ/2]$ where uniform continuity is not satisfied?

No, we didn't. This argument shows that $f$ is not uniformly continuous in all $\mathbb{R}$. See that, indeed, we are denying definition of uniformly continuous:

There is an $\epsilon>0$ (in this case $\epsilon=1$) such that for all $\delta>0$ there are $x,y\in\mathbb{R}$ satisfying $|x-y|<\delta$ and $|f(x)-f(y)|\ge\epsilon$ ($x=1/\delta$ and $y=1/δ+δ/2$ on this case).

notice that you example is for the WHOLE REAL AXIS $R^1$

so $y = x^2$ is not uniform continuous on $R^1$

but still uniform continuous on a given closed interval $[a,b]$, where $-\infty < a < b < \infty$

Not every $\delta$ will work! You've fixed $\epsilon=1$. Now I need to find a small $\delta$, and I can choose it depending on:

• The function $f$
• The interval $[a,b]$

Let's say $a=0$ and $b=1$. Then for instance we could choose $\delta=1/10$ and still have plenty of wiggle room.