If $f$ is continuous & $\lim_{|x|\to {\infty}}f(x)=0$ then $f$ is uniformly continuous or NOT?

Let, $f:\mathbb R\to \mathbb R$ be a continuous function such that $\lim_{|x|\to {\infty}}f(x)=0.$ Then prove or disprove that $f$ is uniformly continuous.

I tried through the formal definition of uniform continuity but I could not proceed further.

Is it directly follow from definition or any other property about continuity to prove this?

Please help....


Define $\phi(x) = \begin{cases} f(\tan x), & |x| < {\pi \over 2} \\ 0, & |x|={\pi \over 2} \end{cases}$. It is easy to see that $\phi:[-{\pi \over 2},{\pi \over 2}] \to \mathbb{R}$ is continuous, hence uniformly continuous since $[-{\pi \over 2},{\pi \over 2}]$ is compact.

We have $f(x) = \phi(\arctan x)$, and since $|\arctan'(x)|<1$, we see from the mean value theorem that $|\arctan x -\arctan y| \le |x-y|$.

Let $\epsilon>0$ and choose $\delta>0$ be such that if $|x-y| < \delta$ then $|\phi(x)-\phi(y)| < \epsilon$. Since $|\arctan x -\arctan y|< \delta$, we have $|f(x)-f(y)| = |\phi(\arctan x) - \phi(\arctan y) | < \epsilon$, and so $f$ is uniformly continuous.


Hint: To show that, first fix $\epsilon >0$, then your assumption imply that there is $M>0$ so that

$$|f(x)| < \frac{\epsilon}{2}$$

when $|x| >M$. What can you say about

$$|f(x) - f(y)|$$

when $|x|, |y| >M$? And what about $f$ on $[-(M+1), M+1]$?