Consequence of uniform continuity $f:\mathbb R \rightarrow \mathbb R$ is a uniformly continuous function such that $f(n) \rightarrow 0$ as $n \rightarrow \infty$ where $n \in \mathbb N$. I have to find a counterexample to show that $f(x)$ may not converge to $0$ as $x \rightarrow \infty$. If we assume that $f(x^2)$ is uniformly continuous, then $f(x) \rightarrow 0$ as $x \rightarrow \infty$.
I think $f(x) = \sin2\pi x$ works for the first part. What can I do about the second part?

For easier notation let $g(x)=f(x^2)$. By assumption we know that $g(\sqrt{n})\to 0$ when $n\to\infty$. Now, we have:
$\sqrt{n+1}-\sqrt{n}=\frac{1}{\sqrt{n+1}+\sqrt{n}}\to 0$
So now let $\epsilon>0$. Since $g$ is uniformly continuous there is some $\delta>0$ such that $|x-y|<\delta$ implies $|g(x)-g(y)|<\frac{\epsilon}{2}$. Also, since $\sqrt{n+1}-\sqrt{n}\to 0$ there is some $n_1\in\mathbb{N}$ such that $n\geq n_1$ implies $\sqrt{n+1}-\sqrt{n}<\delta$. Finally, since $g(\sqrt{n})\to 0$ there is $n_2\in\mathbb{N}$ such that $n\geq n_2$ implies $|g(\sqrt{n})|<\frac{\epsilon}{2}$.
So now let $n_0=\max\{n_1,n_2\}$. Assume $x>\sqrt{n_0}$ is any real number. Let $n$ be the largest natural number such that $\sqrt{n}\leq x$. Then $n\geq n_0$ and $\sqrt{n}\leq x<\sqrt{n+1}$. Since $n\geq n_0\geq n_1$ we have:
$-\delta<0<x-\sqrt{n}<\sqrt{n+1}-\sqrt{n}<\delta$.
In other words $|x-\sqrt{n}|<\delta$. Hence $|g(x)-g(\sqrt{n})|<\frac{\epsilon}{2}$. But also, $n\geq n_0\geq n_2$ and so $|g(\sqrt{n})|<\frac{\epsilon}{2}$. It follows from the triangle inequality that $|f(x^2)|=|g(x)|<\epsilon$.
Alright, so we proved that there is a positive number $M:=\sqrt{n_0}$ such that $x>M$ implies $|f(x^2)|<\epsilon$. It follows that if $x>M^2$ then $|f(x)|=f((\sqrt{x})^2)|<\epsilon$. So indeed $f(x)\to 0$.
