Proving uniform continuity on an interval

If I know that $f:(0,\infty)\rightarrow \Bbb R$ is uniformly continuous on the intervals $[a,\infty)$ and $(0,a]$, where $a$ is in $(0,\infty)$, how can I prove that it is uniformly continuous on $(0,\infty)$? I know the general definition of uniform continuity using epsilon-delta, but I am not sure how to apply it to the above.

Thanks

Edit: I meant Uniformly continuous on the first two intervals


Set $I=(0,a]$ and $J=[a,\infty)$. Let $\epsilon>0$.

Choose $\delta_1>0$ such that $|f(x)-f(y)|<\epsilon/2$ for all $x\in I$ and $y\in I$ with $|x-y|<\delta_1$.

Choose $\delta_2>0$ such that $|f(x)-f(y)|<\epsilon/2$ for all $x\in J$ and $y\in J$ with $|x-y|<\delta_2$.

Let $\delta=\min\{\delta_1,\delta_2\}$.

Then if $|x-y|<\delta$:

If $x$ and $y$ are both in $I$ or both in $J$, $|f(x)-f(y)|<\epsilon/2<\epsilon$.

If $x\in I$ and $y\in J$, or $x\in J$ and $y\in I$

$$ |f(x)-f(y)|\le |f(x)-f(a)|+|f(a)-f(y)|<\epsilon/2 +\epsilon/2=\epsilon. $$