Proving that a function is uniformly continuous having the limit 
Let $$f:[0,\infty)\rightarrow \mathbb R$$ be a continuous function. Suppose that $$\lim_{x\rightarrow\infty}f(x) = L$$
Prove that f is uniformly continuous on $[0,\infty)$.

 A: Let $\epsilon > 0$. We want to find a $\delta > 0$ that witnesses continuity for every $x\in[0,\infty)$.
As $\lim_{x\rightarrow \infty} f(x) = L< \infty$, there exists a $K$ such that if $x>K$, then $|f(x) - L| < \epsilon/2$. Then, for any $x_1,x_2 > K$, we know $|f(x_1) - f(x_2)|\leq |f(x_1) -L| + |L- f(x_2)| < 2\cdot \epsilon /2 = \epsilon$. This shows that $f(x)$ is "eventually" uniformly continuous.
Now, consider $[0,K]$. As this is a closed, bounded interval, the restriction of $f$ to $[0,K]$ is uniformly continuous. Pick a $\delta_1$ such that if $x_1,x_2\in [0,K]$ and $|x_1 - x_2| < \delta_1$, then $|f(x_1) - f(x_2)| < \epsilon$.
Now we are nearly done, if we pick $x_1,x_2$ that are both in $[0,K]$ or both in $[K,\infty)$ and are within $\delta_1$ of one another, then $f(x_1)$ and $f(x_2)$ are within $\epsilon$ of one another. What if we pick $x_1\in [0,K]$ and $x_2\in [K,\infty)$ though? Here we need a hot-fix. Consider the interval $[K-\delta_1, K+\delta_1]$. If $x_1\in [0,K], x_2\in[K,\infty)$, and $|x_1-x_2|<\delta_1$, then both $x_1,x_2\in [K-\delta_1,K+\delta_1]$. This interval is also closed and bounded, so there is a $\delta_2$ that witnesses uniform continuity on this interval for $f(x)$ and $\epsilon$.
Chooose $\delta = \min\{\delta_1,\delta_2\}$.
