Show that the function $f: x \rightarrow x^2$ is uniformly continuous on the set $S = \bigcup \{[~n~,~n + n^{-2}~] ~|~n \in \mathbb N\}$
Attempt:
Let $S_n = [~n~,~n + n^{-2}~]$. then diam $S_n = \dfrac {1}{n^2}$ which is clearly dependent on $n$.
If we limit the set $S$ upto $m$ natural numbers, then surely the function is uniformly continuous (since a function which is uniformly continuous over each disjoint subset which are finite in number and at non zero distance from each other, is also uniformly continuous over their union).
But, here the diameter of each $S_n$ is ever changing with each natural number.
Any advice on how to move forward with this problem will be appreciated. Thanks!
Note that $$|f(x)-f(y)|=|x^2 -y^2|= |x-y||x+y|.$$
Thus for $x$ and $y$ in $[k,k+\frac {1}{k^2}]$ we have $$ |f(x)-f(y)|\le \frac {1}{k^2} (2k+ \frac {2}{k^2})$$
Let $\epsilon >0$ be an arbitrary small number.
Pick a natural number $n_0$ such that $$ \frac {1}{n_0^2} (2n_0+ \frac {2} {n_0^2})<\epsilon$$
If $n\ge n_0$ then $$ \frac {1}{n^2} (2n+ \frac {2} {n^2}) < \frac {1}{n_0^2} (2n_0+ \frac {2} {n_0^2})<\epsilon$$
The first two interval intersect at $x=2$, therefore the union of the first two interval, $[1,2\frac {1}{4}]$requires special attention.
The function $ f(x) =x^2$ is uniformly continuous on $[1,2\frac {1}{4}],$ thus for our given $\epsilon$ there exists a $ \delta _1$ satisfying the condition of uniform continuity on $[1,2\frac {1}{4}].$
Note that $f(x)=x^2$ is also uniformly continuous on each of closed intervals $$ [k,k+\frac {1}{k^2}]$$ for $k=3,...,n_0-1$.
We can find $$\delta _3, \delta _4, \delta _5,...., \delta _{n_0-1}$$ to satisfy the condition of uniform continuity on $ [k,k+\frac{1}{k^2}]$.
Let $\delta_2 = \delta_1$ and choose $$\delta = min( 1/4, \delta _1, \delta _2, \delta_3,...., \delta _{n_0-1})$$.
We have $$ |x-y| < \delta \implies |x^2 -y^2| < \epsilon $$ on the given union.
Thus $f(x) = x^2$ is uniformly continuous on the given union.