Prove that if f is a continuous function on $\mathbb{R}$ then f is uniformly continuous

Prove the following. If f is a continuous function on $\mathbb{R}$ and

$\lim _{x\to +\infty \:}f(x) =0=\lim _{x\to -\infty} f(x)$

then f is uniformly continuous on R

My best guess is to use the definitions of right hand limit and left hand limit, and show that x0 is a second kind of discontinuity. Am I on the right track? How would I prove this?

• What do you mean discontinuity? $f$ is continuous. – Trevor Gunn Nov 19 '17 at 17:20
• I was thinking of assuming discontinuity and then showing by contradiction it is continuous. I don't know if that is a good way of proving though – user504760 Nov 19 '17 at 17:25
• Possible duplicate of If $f$ is continuous and with a limit at infinity then $f$ is uniformly continuous – José Carlos Santos Nov 19 '17 at 17:26
• @user50476 Not uniformly continuous does not mean not continuous. Look back through your notes. You should have some results about when functions are uniformly continuous. – Trevor Gunn Nov 19 '17 at 17:28

Given $\epsilon > 0$, there are $\delta_0 > 0$ such that if $x > \delta_0$ or $x < -\delta_0$ then $|f(x)| < \epsilon /2$. Therefore, if $x,y \notin (-\delta_0, \delta_0)$ , $$| f(x) - f(y)| < \epsilon .$$
By other side, as all function continuos on compact set is uniformly continuos, $f$ is uniformly continuos on $[-\delta_0, \delta_0]$ and theferore exist $\delta > 0$ such that $x,y \in [-\delta_0, \delta_0]$ and $|x - y| < \delta$, then
$$| f(x) - f(y)| < \epsilon .$$
Therefore the affirmation above is true for all $R$. Proving that $f$ is uniformly continuos on $R$