If there is $a>0$ s.t. $f|[0,a]$ and $f|[a, +\infty)$ are uniformly continuous, $f:[0, +\infty) \rightarrow \mathbb{R}$ also is Given $f:[0, +\infty) \rightarrow \mathbb{R}$, suppose that exists $a>0$ such that $f|[0,a]$ and $f|[a, +\infty)$ are uniformly continuous. Prove that $f$ is uniformly continuous.
Any hints on how to go about this? I've tried using the definition, but this is not like proving if $f$ and $g$ are u.c., then $f+g$ is as well. The best result I know is that if $f$ and $g$ are uniformly continuous and the codomain of $f$ is the same as the domain of $g$, $g \circ f$ is also uniformly continuous.
I'm not looking for a particular proof of it all, just a potential proposition that could help me see it.
 A: The best way to prove this is directly from the definition. If $f|_{[0,a]}$ is uniformly continuous, you know that for any $\varepsilon_1 > 0$ there exists a $\delta_1 > 0$ such that if $|x - y| < \delta_1$ and $x,y \in [0,a]$ then $|f(x) - f(y)| < \varepsilon_1$. Similarly, if $f|_{[a,\infty)}$ is uniformly continuous, you know that for any $\varepsilon_2 > 0$ there exists $\delta_2 > 0$ such that if $|x - y| < \delta_2$ and $x,y \in [a, \infty)$ then $|f(x) - f(y)| < \varepsilon_2$.
Given $\varepsilon > 0$, you want to find $\delta > 0$ such that if $|x - y| < \delta$ and $x,y \in [0,\infty)$ then $|f(x) - f(y)| < \varepsilon$. The naive attempt is to take $\varepsilon_1 = \varepsilon$ and obtain $\delta_1$ which works on $[0,a]$, take $\varepsilon_2 = \varepsilon$ and obtain a $\delta_2$ which works on $[a,\infty)$ and then you might hope that $\delta = \min (\delta_1, \delta_2)$ will give you a $\delta$ that works on $[0,\infty)$. An indeed, this almost works as this guarantees that 
$$ |f(x) - f(y)| < \varepsilon $$
if both $x,y$ are in $[0,a]$ or both $x,y$ are in $[a,\infty)$. But what happens if $x \in [0,a]$ and $y \in [a,\infty)$? Try and think how you can estimate $|f(x) - f(y)|$ in this case and modify the argument accordingly. You will need to use the triangle inequality and compare everything to the values of $f$ at some point.
A: I have just found a more direct and simple answer.
Let $\varepsilon>0$ be an arbitrary number. Uniform continuity of the functions $f|[0,a]$ and $f|[a,+\infty)$ implies that there exist numbers $0<\delta_1, \delta_2<1$ such that if $0\le x,y\le a$ and $|x-y|<\delta_1$ then $|f(x)-f(y)|<\varepsilon/2$ and 
if $a\le x,y$ and $|x-y|<\delta_2$ then $|f(x)-f(y)|<\varepsilon/2$. 
If we put $\delta=\min\{\delta_1,\delta_2\}$ then we shall have $|f(x)-f(y)|<\varepsilon/2<\varepsilon$ for each $0\le x,y$ such that $|x-y|<\delta$ and $x,y\in [0,a]$ or $x,y\in [a,\infty)$. It remains to deal the case when one of the points belongs to $[0,a]$ and the other belongs to $[a,\infty)$. But in this case the point $a$ lies between the points $x$ and $y$ so $|a-x|<\delta$ and $|a-y|<\delta$, thus 
$$|f(x)-f(y)|\le |f(x)-f(a)|+|f(a)-f(y)|\le \varepsilon/2+ \varepsilon/2=\varepsilon.$$
A: The following Lemma is well-known and easy to prove (see, for instance, “General topology” by Ryszard Engelking (Heldermann Verlag, Berlin, 1989)). Let $X$ and $Y$ be topological spaces, $\mathcal F$ be a (locally) finite cover of the space $X$ by its closed subspaces. Given a family $\{f_F:F\to Y | F\in\mathcal F\}$  of continuous functions  such that for each $F,F’\in\mathcal F$ and each point $x\in F\cap F’$ we have $f_F(x)=f_{F’}(x)$, the function $f:X\to Y$ such that $f(x)=f_F(x)$ for any point $x\in X$ and any set $x\in F\in\mathcal F$ is continuous. 
Applying Lemma to a finite closed cover $\mathcal F\{[0,a],[a,+\infty)\}$ of the space $X=[0,+\infty)$ we see that the function $f$ is continuous. In particular, the restriction $f|[0,a+1]$ of the function $f$ on a subspace $[0, a+1]$ of the space $[0,+\infty)$ is continuous. Since the set $[0, a+1]$ is compact then the function $f|[0,a+1]$ is uniformly continuous. Now let $\varepsilon>0$ be an arbitrary number. Uniform continuity of the functions $f|[0,a+1]$ and $f|[a,+\infty)$ implies that there exist numbers $0<\delta_1, \delta_2<1$ such that if $0\le x,y\le a+1$ and $|x-y|<\delta_1$ then $|f(x)-f(y)|<\varepsilon$ and 
if $a\le x,y$ and $|x-y|<\delta_2$ then $|f(x)-f(y)|<\varepsilon$. If we put $\delta=\min\{\delta_1,\delta_2\}$ then we shall have $|f(x)-f(y)|<\varepsilon$ for each $0\le x,y$ such that $|x-y|<\delta$.
A: *

*The restriction of $f$ to $[0.a+1]$ is uniformly continuous since $[0,a+1]$ is compact. This implies that for every $c>0$, there exists $d$ such that for every $x,y\leq a+1, |x-y|<d$ implies that $|f(x)-f(y)|<c$.

*Since the restriction of $f$ to $[a,+\infty)$ is uniformly continuous, there exists $e$ such that $x,y\geq a, |x-y|<e$ implies that $|f(x)-f(y)|<c$.
Take $f=min(d,e,1/2)$, Let $x,y\in [0,+\infty)$ such that $|x-y|<f$, if $x<a+1/2, y<a+1$, since $|x-y|<f<1/2$, since $|x-y|<f\leq d$,1. implies that $|f(x)-f(y)|<c$.
If $x\geq a+1/2,y\geq a$ since $|x-y|<1/2$, since $|x-y<f\leq d$ 2. implies that $|f(x)-f(y)|<c$. We conclude that $f$ is uniformly continuous.
