Need to prove that $f(x)=x^2$ is uniformly continuous on $\bigcup_{n=1}^\infty \left[n, n+\frac1{n^2}\right]$
I know I can prove that f is uniformly continuous on $\left[n,n+\frac{1}{n^2}\right]$ but I'm not sure if it'll apply to this infinite union. Also this union is open, not closed so it's not compact, right?
Lets define $M_l:=\bigcup_{n=1}^l \left[n, n+\frac1{n^2}\right]$ and let $\varepsilon>0$ be arbitrary. Since $$\lim_{n\to\infty}f(n+\frac1{n^2})-f(n) = \lim_{n\to\infty}\frac2n+\frac1{n^4}=0,$$ we can choose $k\in\Bbb N$ with $\varepsilon>f(n+\frac1{n^2})-f(n)>0$ for all $n>k$. It is easy to see now that one can find $\delta>0$, such that $|f(x)-f(y)|<\varepsilon$ for all $|x-y|<\delta$ with $x,y\in M_\infty\setminus M_k$. (This follows from the monotonicity of $f$ and the fact that the intervals $\left[n, n+\frac1{n^2}\right]$ is not getting arbitrarily close to each other.) Since $M_k$ is compact and $f$ is continuous, the restriction of $f$ to $M_k$ is uniformly continuous. Thus, by (possibly) sufficiently shrinking $\delta$, we can achieve $|f(x)-f(y)|<\varepsilon$ with $|x-y|<\delta$ and $x,y\in M_k$. Now we have $f$ uniformly down pat on the whole set $M_\infty$.