Why is $f(x) = x^2$ uniformly continuous on [0,1] but not $\mathbb{R}$ According to How exactly can't $\delta$ depend on $x$ in the definition of uniform continuity?
There is a lot of agreement that $x^2$ is not uniformly continuous. But is $x^2$ uniformly continuous on $[0,1]$?
For example:

Let $f(x) = x^2$, then $|f(x) - f(x_0)| < |(x-x_0)(x+x_0)| < 2|x-x_0|$
Let $|x - x_0| < \delta$, then $|f(x) - f(x_0)| < 2\delta$
Therefore if $\delta = \epsilon/2$ then $|f(x) - f(x_0)| < \epsilon$
  is satisfied and since $\delta$ does not depend on $x$ therefore $f(x) = x^2$ is uniformly continuous

Wouldn't the same proof be applied for $\mathbb{R}$ as well as all subsets of $\mathbb{R}$?
 A: $x^2$ is uniformly continuous on $[0,1]$ because continuous functions are always uniformly continuous on a compact set. 
In your proof, you need $|x+x_0|<2$ to prove uniform continuity, which is true on $[0,1]$ but not on $\mathbb{R}$. So the proof cannot be extended to $\mathbb{R}$.
A: The comments and other answer address the uniform continuity on compact sets. @hermes points out the crux of your proof, that $|x + x_0| < 2$, cannot be extended to all of $\mathbb{R}$. Turns out there is no fix for that.
Let $\varepsilon = 1$. We need to show that for all $\delta > 0$, there exist $x,y$ such that $|x - y| < \delta$ but $|f(x) - f(y)| > 1$. The key is the dependence of $x$ and $y$ on $\delta$. To this end, let $\delta > 0$ be given, and choose $y = x + \frac{\delta}{2}$. Then $|x-y| = \frac{\delta}{2} < \delta$, but 
$$|f(x) - f(y)| = |x^2 - y^2| = \left|x^2 - \left(x^2 + x\delta + \frac{\delta^2}{4}\right)\right| = \left|x\delta + \frac{\delta^2}{4}\right|,$$
and for sufficiently large (or small) $x \in \mathbb{R}$, we can make the last quantity larger than 1. Hence we do not have uniform continuity on $\mathbb{R}$.
