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