Determine if $f(x)=x^2$ is uniformly continuous in the given domain. Determine if the following function is uniformly continuous in the given domain.
$f(x)=x^2 , \quad \text{in}\quad [0,\infty], [0,1]$
My try:
For the domain $[0,\infty]$. Let $(x_n)=n, (y_n)= n +\frac{1}{2n}$
Then $|n-n-\frac{1}{2n}|=\frac{1}{2n} < \frac{1}{n}$
But,  $|(n)^2-(n+\frac{1}{2})^2| = 1 + \frac{1}{(2n)^2} \geq  1 = \epsilon _0$
Then $f(x)=x²$ is not uniformly continuous in  the domain $[0,\infty]$
For the domain $[0,1]$. Let $(x_n)=\frac{1+n}{n}, (y_n)= \frac{1+2n}{2n}$
Then $|\frac{1+n}{n}-\frac{1+2n}{2n}| = \frac{1}{2n} < \frac{1}{n}$
But, $|(\frac{1+n}{n})^2-(\frac{1+2n}{2n})^2|=\frac{1}{n} + \frac{3}{4n^2} \geq 1 = \epsilon _0$
Then $f(x)=x²$ is not uniformly continuous in  the domain $[0,1]$
I'm not sure if my method is correct. Any suggestions would be great!
 A: Another way to see that the function is uniformly continuous on $[0,1]$ whithout using Heine's theorem is to prove that the definition of uniform continuity is satisfied.
Indeed, let $\varepsilon > 0$. Let $\eta = \varepsilon/2$. For all $x,y \in [0,1]$ such that $|x-y|<\eta$, you have $$|x^2-y^2| = |(x-y)(x+y)| \leq 2\eta = \varepsilon$$
So the definition is satisfied.
A: It's certainly uniformly continuous on $[0,1]$. In general, a continuous function will always be uniformly continuous on a compact set (as @Bungo pointed out in the comments).
To address the question in the comments:
For example, for any $\varepsilon$, if we just take $\delta=\frac{100}{4 \times 99} \varepsilon$, we have
$$f\left(x+ \frac{99}{100} \delta\right) - f(x) \\
= f(x + \varepsilon/4) - f(x) \\
= x^2 + x\varepsilon/2 + \varepsilon^2/16 - x^2 \\
= x\varepsilon/2 + \varepsilon^2/16 \\
\leq \varepsilon/2 + \varepsilon^2/16 \\
\leq \varepsilon/2 + \varepsilon/16 \\
< \varepsilon$$
P.S. @TheSilverDoe 's answer is much cleaner, so I would check that one out :)
A: Your method for the domain $[0,\infty)$ is correct, and your result is correct as well. But for the domain $[0,1]$, it doesn't work, since your chosen $x_n,y_n$ aren't in the domain. Instead, you could use the fact that continuous functions on compact domains are uniformly continuous.
