# If $f$ is continuous, and $f(x) \rightarrow 2$ as $x \rightarrow \infty$ then $f$ is uniformly continuous

I recently asked for some direction with how to connect a convergent function to proving it is uniformly continuous and I was directed to an awesome post that explained a lot for me. So now I tried to prove this problem which pretty much asks a specific case of that and I was wondering if some people could look it over for errors.

Suppose $f$ is continuous on $[0, \infty)$ and $f(x) \rightarrow 2$ as $x \rightarrow \infty$. Prove $f$ is uniformly continuous on $[0, \infty)$.

Since $f(x) \rightarrow 2$ as $x \rightarrow \infty$, then for $\epsilon>0, \exists k$ s.t. $\forall x \geq k$ we have $|f(x) - 2| < \frac{\epsilon}{2}$.

Also, note that since $f$ is continuous on $[0, \infty)$ it is uniformly continuous on $[0, k+2]$ and so for $\epsilon >0$, $\exists \delta_1 > 0$ s.t. if $x,y \in [0, k+2]$ and $|x-y| < \delta_1$ then $|f(x) - f(y)| < \epsilon$.

Now given $\epsilon >0$, take $\delta = \min(\delta_1, \frac{1}{2}) > 0$. Suppose $x,y \in [0, \infty)$ and $|x-y| < \delta$.

Then if $x > k + 1$, since $|x-y| < \frac{1}{2}$ we have $k+1 - y < x - y < \frac{1}{2}$ and so $y > k$. Together, we have $x, y > k$ and $|x-y| < \delta$, so $|f(x) - f(y)| = |(f(x) - 2) + (-f(y) + 2)| \leq |f(x) -2| + |f(y) - 2| < \frac{\epsilon}{2} + \frac{\epsilon}{2} = \epsilon$.

If $x \leq k + 1$, since $|x - y| < \frac{1}{2}$, then we have $y < k + \frac{3}{2} < k+2$. Together then, we have $x, y \in [0,k+2]$ and $|x-y| < \delta \leq \delta_1$ and so $|f(x) - f(y)| < \epsilon$.

Thus we have shown for $\epsilon >0$, there is a $\delta > 0$ s.t. if $x,y \in [0, \infty)$ and $|x-y| < 0$, then $|f(x) - f(y)| < \epsilon$.

• Your proof looks fine for me. Good job. – Crostul Apr 5 '17 at 13:02
• Thats great to hear, thank you! – student_t Apr 5 '17 at 13:02

Since $\displaystyle \lim_{x \to \infty}f(x)=2$ so for a given $\epsilon >0$ ,$\exists$ a real number $k$ such that $|f(x)-2|<\epsilon/2$ whenever $x \ge k$. Now let , $x,y\in [k,\infty)$.
Then , $|f(x)-f(y)|\le |f(x)-2|+|f(y)-2|<\epsilon$ , for every $x,y \in [k,\infty)$ . So particularly ,$|f(x)-f(y)|<\epsilon$ , whenever $|x-y|<\delta$. So $f$ is uniformly continuous in $[k,\infty)$.
Again $[0,k]$ is compact domain, so $f$ is uniformly continuous in $[0,k]$. Hence $f$ is uniformly continuous in $[0,\infty)$.
• How do we know such a $\delta$ exists? – student_t Apr 5 '17 at 17:19