I'm self-learning Real Analysis. I would like to request feedback on the below proof specifically, of the claim that when $g:(a,c)\to\mathbf{R}$ is uniformly continuous over $(a,b]$ and $[b,c)$, it is uniformly continuous over the entire interval $(a,c)$.
Exercise 4.4.5. Assume that $\displaystyle g$ is defined on an open interval $\displaystyle ( a,c)$ and it is known to uniformly continuous on $\displaystyle ( a,b]$ and $\displaystyle [ b,c)$, where $\displaystyle a< b< c$. Prove that $\displaystyle g$ is uniformly continuous on $\displaystyle ( a,c)$.
Proof.
Let $\displaystyle ( a_{n})\rightarrow a$ be an arbitrary sequence in $\displaystyle ( a,b]$. Since $\displaystyle ( a_{n})$ is Cauchy, there exists $\displaystyle N\in \mathbf{N}$, such that $\displaystyle | a_{n} -a_{m}| < \delta $ for all $\displaystyle n >m\geq N$.
Pick an arbitrary $\displaystyle \epsilon >0$. Since, Since, $\displaystyle g$ is uniformly continuous over $\displaystyle ( a,b]$, there exists $\displaystyle \delta >0$, such that for all $\displaystyle x,y\in ( a,b]$, where $\displaystyle | x-y| < \delta $, we have $\displaystyle | g( x) -g( y)| < \epsilon $.
Thus, $\displaystyle | a_{n} -a_{m}| < \delta $ implies $\displaystyle | g( a_{n}) -g( a_{m})| < \epsilon $ for all $\displaystyle n >m\geq N$. Consequently, $\displaystyle ( g( a_{n}))$ is Cauchy and therefore convergent.
Let $\displaystyle g( a) =\lim g( a_{n})$.
Take another sequence $\displaystyle ( b_{n})\rightarrow a$. Since, $\displaystyle ( b_{n} -a_{n})$ is Cauchy, the distance $\displaystyle | b_{n} -a_{n}| $ can be made as small as we please. From the uniform continuity of $\displaystyle g$, it follows that if $\displaystyle | b_{n} -a_{n}| < \delta $, $\displaystyle | g( b_{n}) -g( a_{n})| < \epsilon $. Consequently, $\displaystyle \lim g( b_{n}) =\lim g( a_{n}) =g( a)$.
Define:
\begin{equation*} h( x) =\begin{cases} \lim g( a_{n}) & ,\forall ( a_{n}) \ \text{such that }( a_{n})\rightarrow a,\ \text{if } x=a\\ g( x) & ,a< x< c\\ \lim g( c_{n}) & ,\forall ( c_{n}) \ \text{such that }( c_{n})\rightarrow c,\ \text{if } x=c \end{cases} \end{equation*}
Consequently, $\displaystyle h$ is continuous over a compact set $\displaystyle K=[ a,c]$. Thus, $\displaystyle h$ is uniformly continuous over $\displaystyle K$. So, $\displaystyle h$ is uniformly continuous over any subset of $\displaystyle K$, such as $\displaystyle ( a,c)$.
Some value $\delta_1$ is small enough to assure that $|g(x)-g(y)|<\varepsilon$ whenever $x,y\in(a,b]$ and $|x-y|<\delta_1.$
Some value $\delta_2$ is similarly small enough for the interval $[b,c).$
I was going to say $\text{“let }\delta=\min\{\delta_1,\delta_2\}\text{”}$ and leave it there, but then I realized there's the case where $a<x<b<y<c,$ so $x,y$ are not both within the same one of those two intervals.
So pick $\delta_1,\delta_2$ small enough so that $|g(x)-g(y)|<\varepsilon/2$ whenever $x,y$ differ by less than $\delta = \min\{\delta_1,\delta_2\}$ and both are in the same one of the two intervals. Then consider the case $a<x<b<y<c$ and $|x-y|<\delta.$ Then you have $|g(x)-g(b)|<\varepsilon/2$ and $|g(b)-g(y)|<\varepsilon/2,$ so by the triangle inequality, $|g(x)-g(y)|<\varepsilon.$
All that stuff about sequences is not needed here.