Show $(a,b)$ is connected using $(a,b]$ is connected Given the usual topological space $(\Bbb{R}, \tau_d)$ of $\Bbb R$ where $d$ is the Euclidean metric, a subset $X$ of $\Bbb R$ is said to be connected if the subspace topological space $(X,\tau _X)$ is connected, i.e. the clopen sets in $(X,\tau _X)$ can only be $\emptyset, X$.
My professor's lecture notes have proved an interval of type $(a,b]$ where $a,b\in\Bbb R,a<b$ is connected. The proof is long and tricky. 
Now I want to use the fact that $(a,b]$ is connected to prove $(a,b)$ is connected. 

Assume $(a,b)$ is not connected, then $\exists G_1,G_2$ which are open sets in $\tau_{(a,b)}$ st. $(a,b)=G_1\bigcup G_2$ and $G_1\bigcap G_2=\emptyset$. 
  Since $b=\sup(a,b)$, then either $b=\sup G_1$ or $b=\sup G_2$.
Without loss of generality, suppose $b=\sup G_1$. If we can show $G_1\bigcup\{b\}\in\tau _{(a,b]}$, then $(G_1\bigcup\{b\})\bigcup G_2=(a,b]$ and $G_1\bigcup\{b\}$,$G_2$ are disjoint open sets in $\tau _{(a,b]}$, which is a contradiction with the fact that $(a,b]$ is connected.

However, I have tried but was not able to prove $G_1\bigcup\{b\}\in\tau _{(a,b]}$. Can anyone help with a proof of this or there is another way to show $(a,b)$ is connected? Thank you!
 A: To elaborate on the comment of @Giovanni, you can do the following. 
First, it is a nice exercise for you (which uses only the definitions), to show that
A topological space $(X,T)$ is connected if and only if each continuous function $f :X \to \{0,1\}$ is constant. Here, $\{0,1\}$ is equipped with the discrete topology. 
Now, choose $n_0 \in \Bbb{N}$ with $a < b -1/n_0$ and choose $x_0 \in (a, b -1/n_0)$ arbitrarily. Define
$$
X_n =(a, b - 1/n]
$$
and note
$$
X := (a,b)= \bigcup_{n \geq n_0} X_n. 
$$
Let $f:X \to \{0,1\}$ be continuous. Since each $X_n$ is connected (and since $f$ restricted to $X_n$ is continuous), we have $f \equiv c_n$ on $X_n$. But because of $x_0\in X_n$, we get $c_n = f(x_0)$ for all $n$, so that the constant is independent of $n$. 
It is now easy to see $f \equiv f(x_0)$ on all of $X$. As noted above, this shows that $X$ is connected. 
Abstractly, what we used/showed here is that a union of connecte sets, all of which share a common point, is connected. This can of course be generalized a bit. It even suffices if every pair of the sets in the union has nonempty intersection (we only need that the constant ($c_n$ above) is independent of the chosen set). 
A: If you already know that either $sup(G_1)=b$ or $sup(G_2)=b$ and not both, that is enough to prove the union of some of them with $\{b\}$ is open. If, for instance, $sup(G_1)=b$ and $sup(G_2) < b$, then there's some open ball from the subspace topology $\tau_{(a,b]}$ centered in $b$ entirely contained in $G_1 \cup \{b\}$. This would suffice to show that $G_1 \cup \{b\}$ is open in $\tau_{(a,b]}$, as $G_1$ is supposed to be open in $\tau_{(a,b)}$.
But I'm thinking that maybe the intended proof was more like this: as $(a,b]$ is connected, so is $[c,d)$. Now write $(a,b)=(a,\frac{a+b}{2}] \cup [\frac{a+b}{2},b)$ as the union of two connected sets with non empty intersection. Therefore $(a,b)$ is connected.
