Uniform continuous with simple properties $f$ is a map from $f:\mathbb{R} \rightarrow \mathbb{R}$. Let $f$ be continous and assume $f$ is both uniformly contiuous on $(-\infty,0]$ and $[0,\infty)$ . Show that $f$ is uniformly continuous on all of $\mathbb{R}$.
I would've thought that the function $f$ is actually uniformly continuous over all the real numbers since it is in both the intervals $(-\infty,0]$ and $[0,\infty)$. I guess the "problem" arises on $f(0)$. Do I have to use that $f(x)$ and $f(y)$ for $x<0<y$ somehow and $f(0)$?
How would such a proof be done?
 A: We wish to show, for all $\varepsilon > 0$, there exists some $\delta > 0$ such that, for all $x, y \in \Bbb{R}$ (might as well assume $x < y$),
$$|x - y| < \delta \implies |f(x) - f(y)| < \varepsilon.$$
As you seem to be aware, there are three cases of note: either $x < y \le 0$, $0 \le x < y$, or $x < 0 < y$. We need a $\delta$ small enough to cover whichever case it happens to be. The tricky one seems to be the third case: $x < 0 < y$, which we can cover using continuity at $0$.
Because $f$ is continuous at $0$, there exists some $\delta_1 > 0$ such that
$$|x| < \delta_1 \implies |f(x) - f(0)| < \frac{\varepsilon}{2}.$$
If we have $|x - y| < \delta_1$ with $x < 0 < y$, then
$$|x| = -x < y - x = |x - y| < \delta,$$
and similarly,
$$|y| = y < y - x = |x - y| < \delta.$$
Therefore, for such $x$ and $y$ we have
$$|f(x) - f(0)| < \frac{\varepsilon}{2} \text{ and } |f(y) - f(0)| < \frac{\varepsilon}{2}.$$
Thus,
$$|f(x) - f(y)| \le |f(x) - f(0)| + |f(0) - f(y)| < \varepsilon.$$
This covers the $x < 0 < y$ case. To complete the full proof, let $\delta_2 > 0$ such that
$$|x - y| < \delta_2 \text{ and } x, y \le 0 \implies |f(x) - f(y)| < \varepsilon$$
and $\delta_3 > 0$ such that
$$|x - y| < \delta_3 \text{ and } x, y \ge 0 \implies |f(x) - f(y)| < \varepsilon.$$
Then
$$|x - y| < \min\{\delta_1, \delta_2, \delta_3\} \implies |f(x) - f(y)| < \varepsilon,$$
as required.
