I'm having trouble with understanding one detail in this proof. I'd greatly appreciate if anyone can help.

Let $\displaystyle f:[0,\infty\) \rightarrow R$ be a continuous function. Suppose $\displaystyle \lim_{x \to \infty} f(x)= L$ exists and finite. Then $\displaystyle f$ is uniformly continuous on $\displaystyle [0,\infty\)$.

Proof: Let $\displaystyle \epsilon >0$. Since $\displaystyle f(x) \rightarrow L$ as $\displaystyle x \rightarrow \infty$, there exists $\displaystyle N>0$ st when $\displaystyle x>N$ we have $\displaystyle \mid f(x)-L \mid <\frac{\epsilon}{2}$. We know $\displaystyle f$ is uniformly continuous on$\displaystyle [0,2N]$ since $\displaystyle [0,2N]$ is compact and $\displaystyle f$ is continuous. Hence, there exists $\displaystyle \delta_1>0$ st for every $\displaystyle x,y \in [0,2N]$ , $\displaystyle \mid x-y \mid < \delta_1 \Rightarrow \mid f(x)-f(y)\mid < \epsilon$. Choose $\displaystyle \delta=min\{\delta_1,N/2\}$. Then any two points $\displaystyle x,y \in [0,\infty)$ satisfying $\displaystyle \mid x-y \mid <\delta$ are either both in $\displaystyle \[0,2N]$ or both in $\displaystyle [N,\infty)$. I understand the rest of the proof. The important detail that I don't get is this lineI don't see why $\displaystyle x,y$ must be both in $\displaystyle [0,2N]$ or both in $\displaystyle [N,\infty)$. I guess it must have something to do with the distance between them less than delta, but I don't see it. I also don't see why we need the distance less than $\displaystyle N/2$.Choose $\displaystyle \delta=min\{\delta_1,N/2\}$. Then any two points $\displaystyle x,y \in [0,\infty)$ satisfying $\displaystyle \mid x-y \mid <\delta$ are either both in $\displaystyle \[0,2N]$ or both in $\displaystyle [N,\infty)$