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?
 A: Hint: Given $\epsilon >0$ there exists $\delta >0$ such that  $|f(x^{2})-f(y^{2})| <\epsilon$ for $|x-y|<\delta$. But then $n \leq x \leq n+1$ implies $|f(x)-f(n)| <\epsilon$ provided $|\sqrt x -\sqrt n |<\delta$.  But $|\sqrt x -\sqrt n|=\frac {|x-n|} {\sqrt x +\sqrt n} \leq \frac 1 {\sqrt n} <\delta $ provided $n$  is large enough. This gives $|f(x)-f(n) |<\epsilon$ whenever $x \geq [\frac  1 {\delta^{2}}]$. So $|f(x)| <2\epsilon$  if $x > [\frac  1 {\delta^{2}}]$ and $|f([x] )| <\epsilon$.
A: 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$.
A: Suppose by contradiction that $f$ doesn't converge to $0$ at $\infty$. We can find $a >0$ and a strictly increasing sequence$\{x_n\}$ with $\vert f(x_n) \vert \ge a$ for all $n \in \mathbb N$.
But then $\vert \sqrt{x_n} - \sqrt{\lfloor x_n \rfloor}\vert \to 0$ while $\vert f(x_n) - f(\lfloor x_n \rfloor) \vert \ge a/2$ for $n$ large enough as $\lim\limits_{n \to \infty} f(n) = 0$. In contradiction with the uniform continuity of $f(x^2)$.
