If a function is uniformly continuous on $(-\infty,-1]$ and $[-1,\infty)$ is it uniformly continuous on $\mathbb{R}$ Is it correct to say that if $f(x)$ is uniformly continuous on $(-\infty,-1]$ and $[-1,\infty)$, then it is uniformly continuous on $\mathbb{R}$?
I don't think this is true but cannot think of a counterexample. Below there is an example of where I want to use this.
Thanks for any help

Prove that $f(x)=|x|^{\frac{1}{2}}$ is uniformly continuous on $\mathbb{R}$

Proof.
As $|x|^{\frac 12}$ is differentiable on $(-\infty,-1]$ and $[1,\infty)$ with the derivatives bounded then it is uniformly continuous on these intervals.
It is also continuous on $[-1,1]$ and so it is uniformly continuous. 
It is therefore continuous on $\mathbb{R}$.
 A: Yes. If a function is uniformly continuous on each of finitely many closed intervals, then it is also uniformly continuous on their union.
Go back to the definition of uniform continuity on each of the subintervals: For every $\varepsilon>0$ that gives us a $\delta>0$ such that the variation of $f$ on a length-$\delta$ interval is bounded by $\varepsilon/2$. For a given $\varepsilon$, the $\delta$s for the various subintervals will have a positive minimum (because there are finitely many of them), and this minimum works as a $\delta$ everywhere. (Near an interval boundary, allot $\varepsilon/2$ of variation to each of the intervals. Bound the $\delta$ globally such that there is never a need to cross more than one interval boundary in each direction).
A: As an answer for the original question, $f(x)$ being uniformly continuous on $(-\infty,-1]$ and $[1,\infty)$, is not sufficient for it to be uniformly continuous on $\mathbb{R}$ because we do not know about the function's behaviour in $[-1,1]$. But if it is given that $f$ is continuous on $[-1,1]$ then  we can deduce that $f$ is uniformly continuous on $\mathbb{R}$. Indeed it is a necessary condition. 
A: Given $\epsilon>0$ we need to find $ \delta>0$ such that for all real $x,y $ if $|x-y|< \delta$ then $|f(x)-f(y)| < \epsilon$
If $x, y∈(−∞,−1]$ or $x, y∈[−1,∞)$ then we have corresponding $\delta$ s which work. For the remaining case it's a matter of choosing two points $x,y$ such that $x∈(−∞,−1]$ and $y∈[−1,∞)$ and observing that $|x−y| \leq |x−(−1)|+|(−1)−y|$ so that there exist $δ_1>0$ such that $|f(x)−f(−1)|<ϵ/2 $ and $|f(−1)−f(y)|<ϵ/2$ provided that $|x−(−1)|<δ_1$ and $|(−1)−y|<δ_1$ 
Once we choose the minimum of the $3 \ δ$s (one that work for $[−1,∞)$, one that work for the $(−∞,−1]$ and $δ_1$ ) then we have the required $\delta.$ 
