# Uniform continuity on two subsets of $\mathbb R$ implies uniform continuity on $\mathbb R$

Suppose $a$ is a fixed real number and $f$ is a function which is uniformly continuous on both the intervals $(-\infty, a]$ and $[a,\infty)$. Show that f is uniformly continuous on $(-\infty,\infty)$.

If $f$ is uniformly continuous then $\forall \epsilon >0$ $\exists \delta$ such that $\lvert x-x_0 \rvert < \delta \implies \lvert f(x)-f(x_0) \rvert < \epsilon$

I want to use contradiction and say assume $f$ is not uniformly continuous on $(-\infty,\infty)$ so that $\lvert f(x)-f(x_0) \rvert \ge \epsilon$

So I would need to show that the sum of $f$ on $(-\infty, a]$ and $[a,\infty)$ is less than $\epsilon$?

Can I use an inequality somehow to connect $\lvert f(x)-f(x_0) \rvert < \epsilon$ on $(-\infty,a]$and $[a,\infty)$ and $\lvert f(x)-f(x_0) \rvert \ge \epsilon$ on $(-\infty,\infty)$

• The negation of the statement is: $\exists\,\epsilon>0\;\forall\,\delta>0\;\exists x,y\in\Bbb R:|x-y|<\delta$ and $|f(x)-f(y)|\ge\epsilon$. – Tim Raczkowski Nov 5 '15 at 15:06
• @TimRaczkowski I get that but how can I choose an $\epsilon$ to give me a contradiction – Ryan T. Donnelly Nov 5 '15 at 15:13
• Well you can't choose it. You can only assume it exists. This problem is probably easier to prove directly. – Tim Raczkowski Nov 5 '15 at 15:16
• @TimRaczkowski can you give me some insight – Ryan T. Donnelly Nov 5 '15 at 15:23
• Working on an answer now. – Tim Raczkowski Nov 5 '15 at 15:24

Choose a $\delta_1,\delta_2>0$ so that $x,y\in(-\infty,a], |x-y|<\delta_1\implies |f(x)-f(y)|<\epsilon/2$ and $x,y\in[a,\infty),|x-y|<\delta_2\implies |f(x)-f(y)|<\epsilon/2$. Let $\delta<\min\{\delta_1,\delta_2\}$.

Now, let $x<a$ and $y>a$ with $|x-y|<\delta$. Since $|x-a|,|y-a|<\delta$ $$|f(x)-f(y)|\le |f(x)-f(a)|+|f(a)-f(y)|<\epsilon/2+\epsilon/2=\epsilon.$$

• this isn't a contradiction though, correct? – Ryan T. Donnelly Nov 5 '15 at 15:35
• Correct. I mentioned that I thought it was easier to prove the statement directly rather than by contradiction. – Tim Raczkowski Nov 5 '15 at 15:36

First note that $f$ is left-continuous at $a$ as a consequence of the fact that $f$ is uniformly continuous at $(-\infty,a]$. Likewise we find that $f$ is right-continuous at $a$ and this together implies that $f$ is continuous at $a$.
If $f$ is not uniformly continuous on $\mathbb R$ then some $\epsilon>0$ exists together with sequences $(x_n)_n$ and $(y_n)_n$ such that $|x_n-y_n|<\frac1{n}$ and $|f(x_n)-f(y_n)|\geq\epsilon$. Without loss of generality it can be assumed that $x_n<y_n$ for each $n$.
If the set $\{n\in\mathbb N:y_n\leq a\}$ is infinite then a subsequence $(n_k)_k$ can be found with $x_{n_k}<y_{n_k}\leq a$ leading to a contradiction with the fact that $f$ is uniformly continuous on $(-\infty,a]$. So we conclude that this set is finite. Likewise we conclude that the set $\{n\in\mathbb N:x_n\geq a\}$ is finite. So for $n$ large enough we will have $x_n<a<y_n$.
Combined with $|x_n-y_n|<\frac1{n}$ this implies that both sequences $(x_n)_n$ and $(y_n)_n$ are convergent having $a$ as limit. Then $\lim_{n\to\infty}f(x_n)=f(a)=\lim_{n\to\infty}f(y_n)$ since $f$ is continuous at $a$.
We have: $$|f(x_n)-f(y_n)|\leq |f(x_n)-f(a)|+|f(a)-f(y_n)|$$
So the RHS will take a value smaller than $\epsilon$ for $n$ large enough, and a contradiction is found.