How to check that the closure should be connected. Let $A\subset X$ be connected. Then I want to conclude that $\bar A$ is connected.
So I was trying to do the same thing as in the question of this post The closure of a connected set is connected
The thing is that I don't follow the answer, and in fact I think there is something wrong with it. So Can someone explain me why that answer is right? or provide a detail answer for this fact please? 
In fact I don't follow because of @dunstin's comment, since I think he is right.
Thanks a lot in advance.
 A: A space $X$ is connected iff every continuous map from $X$ into $\{0,1\}$ (with the discrete topology) is constant. (This is clear from the definitions; e.g. if such an $f$ were not constant, the inverse images of $\{0\}$ and $\{1\}$ would decompose $X$, etc.)
If $D \subseteq X$ is dense and two functions $f,g: X \rightarrow Y$, where $Y$ is Hausdorff, agree on $D$ (so $\forall x \in D: f(x) = g(x)$), then $f = g$ on $X$. This is a standard fact as well.
The combination of these two immediately implies your fact: suppose $A$ is connected and $A \subseteq B \subseteq \overline{A}$. 
Suppose $f: B \rightarrow \{0,1\}$ is continuous. Then $f|A$ is also continuous, so $\forall x \in A: f(x) = i_0$ for some fixed $i_0 \in \{0,1\}$ ($f$ is constant on the connected set $A$). But then $f$ and $g$, the constant map to $i_0$, agree on the dense set $A$ (the closure of $A$ in $B$ is just the closure of $A$ in the whole space intersected with $B$, but by how $B$ lies in-between them, this just equals $B$), so they agree on $B$. So $f$ is constant and $B$ is connected.  
A: A more direct answer using the definitions and the definition of subspace topology:
Suppose $A \subseteq B \subseteq \overline{A}$ are subsets of a space $X$ and suppose that $A$ is connected. I claim that $B$ is connected as well. (This is a bit more general, and is the same amount of work.)
So suppose $B = U \cup V$ where $U,V$ are disjoint open subsets of $B$. By the definition of the subspace topology, we can write $U = \hat{U} \cap B$, $V = \hat{V} \cap B$, where $\hat{U}, \hat{V}$ are open subsets of $X$.
Then clearly $A \subseteq B = U \cup V \subseteq \hat{U} \cup \hat{V}$, so $A = (\hat{U} \cap A) \cup (\hat{V} \cap A)$. Also $(\hat{U} \cap A) \cap (\hat{V} \cap A) \subseteq (\hat{U} \cap B) \cap (\hat{V} \cap B) = U \cap V = \emptyset$. As $\hat{U} \cap A$ and $\hat{V} \cap A$ are open subsets of $A$ (in the subspace topology), and as $A$ is connected the previous two facts imply that one of $\hat{U} \cap A$ and $\hat{V} \cap A$ is the whole of $A$ and the other is empty. 
So assume wlog that $A = \hat{U} \cap A$, or equivalently $A \subseteq \hat{U}$. And so $\hat{V} \cap A = \emptyset$ or equivalently $A \subseteq X \setminus \hat{V}$.
Now we use that $\hat{V}$ is open, so its complement is closed and so $\overline{A} \subseteq \overline{X \setminus \hat{V}} = X \setminus \hat{V}$. This implies that $\overline{A} \cap \hat{V} = \emptyset$ and so a fortiori $B \cap \hat{V} = V$ is also empty. So we have shown one of $U$ and $V$ to be empty, and so $B$ is connected. 
