# Let $f:\mathbb{R} \rightarrow\mathbb{R}$ such that $f$ is continuous and limit at $\infty$ and $-\infty$ exist then function is uniformly continuous?

Let $f:\mathbb{R} \rightarrow\mathbb{R}$ such that $f$ is continuous and limit at $\infty$ and $-\infty$ exist then function is uniformly continuous?

I do not think this is true as limit may exist at end points but what if function wiggle in between. May be I am wrong. Can I get some hint?

• It cannot wiggle in between because any continuous function on a compact set is uniformly continuous. Your question has been answered before on MSE. Sep 5 '18 at 7:49

Let $L=lim_{x\rightarrow +\infty}f(x), L'=lim_{x\rightarrow -\infty}f(x)$, for every $c>0$, there exists $M>0$ such that $x>M$ implies that $|f(x)-L|<c/4, x<-M$ implies that $|f(x)-L'|<c/4$.
The function is uniformly continuous on $[-3M,3M]$ since $[-3M,3M]$ is compact, there exists $e$ such that for every $x,y\in [-3M,3M], |x-y|<e$ implies that $|f(x)-f(y)|<c$.
Let $d=\inf(e,M)$. Consider $x,y\in \mathbb{R}$, such that $|x-y|<d$, if $x,y\in [-M,M]\subset [-3M,3M], |x-y|<e$ and $|f(x)-f(y)|<c$. If $x,y>M$ or $x,y<-M$, $|f(x)-f(y)|<c$.
Suppose that $x\in [-M,M]$ since $|x-y|<M, |y|<|x|+|M|=2M$, and $|x-y|<3M$, we deduce that $|f(x)-f(y)|<e$.