# If a function is uniformly continuous on $(-\infty,-1]$ and $[-1,\infty)$ is it uniformly continuous on $\mathbb{R}$ [duplicate]

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}$.

-

## marked as duplicate by Arctic Char, Claude Leibovici, Davide Giraudo, Michael Hoppe, egregFeb 16 '14 at 10:20

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).

-
Thanks very much for that, really helpful. – hmmmm Nov 4 '11 at 22:34

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.

-
I don't agree. Your argument would be valid if the intervals were half-closed, but both are closed, so the union is uniformly continuous. – stevenvh Jul 4 '12 at 6:50
@stevenvh — I think the argument is right. The function needs to be continuous on $[-1,1]$. – Lierre Jul 4 '12 at 7:42
@Lierre - the question is about -1 as endpoints of both intervals, not -1 and 1. – stevenvh Jul 4 '12 at 9:28
@Lierre - I don't think it's a typo. It would be silly to leave out ]-1,1[ and conclude that it's uniformly continuous over $\mathbb{R}$. -1 and -1 mentioned 3 times in the question, and that's also how Henning in the accepted answer interpreted it. I therefore rolled back your edit. – stevenvh Jul 4 '12 at 9:43
Of course if the original question has no typo, then it's a matter of choosing two points $x, y$ such that $x\in(-\infty,-1]$ and $y\in[-1,\infty)$ and observing that $|x - y| < |x-(-1)|+|(-1)-y|$ so that there exist $\delta_{1}>0$ such that $|f(x)-f(-1)|< \epsilon/2$ and $|f(-1)-f(y)|<\epsilon/2$ provided that $|x-(-1)|<\delta_{1}$ and $|(-1)-y|<\delta_{1}$ Once you choose the minimum of the 3 $\delta$s (one that work for $[-1,\infty)$, one that work for the $(-\infty,-1]$ and $\delta_{1}$ ) you're done. – Kasun Fernando Jul 5 '12 at 1:14

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.$

-