Proving that $x^2$ is not uniformly continuous We know that $f(x)=x^2$ is not uniformly continuous as a function $f:\mathbb{R}\rightarrow[0,\infty)$. Indeed, let $\epsilon=1$. For any $\delta>0$, we may choose $\alpha>0$ large enough so that $\alpha\delta+\delta^2/4\geq \epsilon$. Then if we set
$$x=\alpha$$
$$y=\alpha+\frac{\delta}{2}$$
we find $|x-y|<\delta$, yet $|f(x)-f(y)|\geq\epsilon$. Hence the $\epsilon-\delta$ definition of uniform continuity is negated and that $f$ is not uniformly continuous.
Now if $X\subset\mathbb{R}$ is any open unbounded set, how do we prove that $f:X\rightarrow [0,\infty)$ is not uniformly continuous? I tried following a similar procedure as above, but it didn't work out. The difficulty I am having is that I can't make sure that $y=\alpha+\delta/2\in X$, because $X$ could be an open unbounded set with narrower open intervals as $x$ increases, for example
$$X=\bigcup_{n=1}^{\infty}(\sqrt{n},\sqrt{n}+\frac{1}{n}).$$
Given the above, is there a way to modify the above proof for the $f:X\rightarrow [0,\infty)$ case? I am not  interested in just being given a proof, but I wanted to know how my proof might be modified, or if it just couldn't be modified in this case.
 A: It is not true.  Consider $X = \bigcup_n (n,n+\tfrac1{n^2})$.  Note if $x,y \in (n,n+\tfrac1{n^2})$, then
$$ |f(x) - f(y)| \le |f(n+\tfrac1{n^2}) - f(n)| = \tfrac2n + \tfrac1{n^2} \le \tfrac3n .$$
Given $\epsilon > 0$, choose $N > \frac3\epsilon$.  If $x,y \in \bigcup_{n\ge N} (n,\frac1{n^2})$, and $|x-y| < \tfrac12$, then $|f(x) - f(y)| < \epsilon$.  And since $f(x)$ is uniformly continuous on $[0,N+1]$, we can find $\delta > 0$ and $\delta < \tfrac12$ such that if $x,y \in [0,N+1]$, then $|x-y| < \delta$ implies $|f(x) - f(y) < \epsilon$.
A: Here a full answer (that i writte too to practice) but take into account that I am just a student so I hope it is correct. First of all your intuition is good and for me you are on the good way.
1 - First let recall the definition of a non uniformly continuous function.
It exists at least one $\epsilon_0>0$ such that for every $\delta>0$ that we can choose it will always exists at least $x$ and $y$ that verifies $|x-y|<\delta$ but $|f(x)-f(y)|>\epsilon_0$.
More formally: $\exists \epsilon_0>0 \; , \forall \delta>0 \; : \; \exists |x-y|< \delta \Rightarrow |f(x)-f(y)| \geq \epsilon_0$
2 - Now let pay attention to the following inequalities:
(1): for any $\delta>0$ given it exists $N=max(1; \left \lceil 1/ \delta \right \rceil)$ s.t. $1/N < \delta$ . Moreover all $n \geq N$ verifies too this inequality.
(2): $\forall n \in \mathbb{N} $ we have $2-\frac{1}{n^2}>\frac{1}{2}$
3 - Now we can writte:
$\exists \epsilon_0 = \frac{1}{2}>0$ such that for any $\delta>0$ it will always exists ,with $n \geq N$ as define in (1), at least two points $x_n=n$ and $y_n=n+1/n$ that despite that verifying $|x_n-y_n|=|1/n| < \delta$ (by (1)) $ \Rightarrow|f(x_n)-f(y_n)|=|2-1/n^2|>1/2$.
More formally: $\exists \epsilon_0 = \frac{1}{2}>0 \; , \forall \delta>0 \; : \; \exists \; x_n = n, \; y_n=n+\frac{1}{n}$ with  $n \geq max(1; \left \lceil 1/ \delta \right \rceil)$
By (1): $|x_n-y_n|< \delta$
By (2): $\Rightarrow |f(x_n)-f(y_n)|=|2-\frac{1}{n^2}| \geq \epsilon_0 = \frac{1}{2}$
Q.E.D.
