TITLE: How to prove uniform continuity?
QUESTION [25 upvotes]: I'm starting out university math and I'm struggling with understanding how to prove uniform continuity. I think I understand the concept of finding a $|x-x_0|<\delta$ for $|f(x)-f(x_0)|<\epsilon$ but all the examples I have found so far have been very vague in explaining how they relate to each other.
I have figured out that the smallest $\delta$ has something to do with the steepest part of the $f()$ function in such way that if $\delta$ satisfies $\epsilon$ in the steepest climb or descent, it will satisfy it everywhere else too.
But the problem I'm facing is that I don't always understand how I'm supposed to figure out the relation between these two variables.
I am able to solve an example like $f(x) = 5x+8$ like so: $x \geq 0, x=x_0+\delta, |f(x)-f(x_0)| = |5(x_0+\delta)+8-5x_0-8| = 5|\delta|$ and thus $5|\delta|<\epsilon$ so the solution is $\delta < \frac{\epsilon}{5}$. This seems easy and reasonable.
Here is an example that I can't crack: $f:[0,\infty[\rightarrow\mathbb{R}, f(x)=x^2$
So what I did first was define $x_0 \geq 0, x=x_0+\delta$
Then I wrote $|f(x)-f(x_0)|<\epsilon$ where $|f(x)-f(x_0)|$ is $|(x_0+\delta)^2 - x_0^2| = |x_0^2 + 2x_0\delta + \delta^2 - x_0^2| = |2x_0\delta + \delta^2|$
At this point many of the examples on the net are saying that I can break this in two parts, $|2x_0\delta| < \frac{\epsilon}{2}$ and $|\delta^2| < \frac{\epsilon}{2}$ and solve them separately. So I get $\delta < \sqrt{\frac{\epsilon}{2}}$ and $\delta < \frac{\epsilon}{4x_0}$
So what am I supposed to do with these two deltas I got? And why am I supposed to break it in parts? Shouldn't I get a single value for the $\delta$?
I understand that because $x^2$ grows at an increasing speed, no $\delta$ can satisfy all $\epsilon$ (and thus it's not uniformly continuous). But I don't know how I'm supposed to get there.
Also, if i confine the $f(x)=x^2$ to $f:[0,5]\rightarrow\mathbb{R}$, how can I then show that it's uniformly continuous?
Many of the documents i've found by googling "uniform continuity" seem to take shortcuts and I get lost.
If someone can explain this in a "layman way" clearly I would be very grateful!

REPLY [5 votes]: Firstly, you must understand that uniform continuity, unlike continuity, is a global condition on the function on its domain. That is, given an $\epsilon>0$ , there exists a $\delta>0$ which only depends on that $\epsilon$ so for any pair of points $x$ and $y$ in the domain, if $|x-y|<\delta$ then $|f(x)-f(y)|<\varepsilon$. An equivalent way to look at this -- that brings this global-ness more to the front -- is to see that, if two sequences (need not be bounded or anything) in the domain: $\langle x_n \rangle$ and $\langle y_n \rangle$ are equivalent (that is, the limit of their difference tends to $0$), then so is $\langle f(x_n) \rangle$ and $\langle f(y_n) \rangle$. An advantage of invoking sequential characterizations of certain properties of functions, is that they are easier to prove than resorting to epsilonics.
Now consider $f(x)=x^2$ on $\mathbb R$, it's easy to see that $\langle n \rangle$ and $\langle n+\frac{1}{n} \rangle$ are quivalent. But, when we apply $f$, we get the sequences $\langle n^2 \rangle$ and $\langle n^2+\frac{1}{n^2}+2 \rangle$ and their difference tends to $2$, that is, they are not equivalent.
Also, remember it helps to understand certain facts such as:

A continuous function on a compact interval is uniformly continuous.
A continuous function thats lipschitz is uniformly continuous.
If a function is uniformly continuous, it'll map a cauchy sequence to a cauchy sequence.