Family of connected sets, proving union is connected I am having some trouble trying to prove the following statement:$$$$
Let $(X,d)$ be a metric space and $\mathcal A$ a family of connected sets in $X$ such that for every pair of subsets $A,B \in \mathcal A$ there exist $A_0$,...,$A_n \in \mathcal A$ that satisfy $A_0=A$, $A_n=B$ and $A_i \cap A_{i+1} \neq \emptyset$ for every i=0,...,n-1. Prove that $\bigcup_{A \in \mathcal A}A$ is connected.
$$$$I've tried to prove it by the absurd: Suppose the union is disconnected, then there exist $U$ and $V$ nonempty disjoint open sets such that $\bigcup_{A \in \mathcal A}A=U \cup V$. Then, there is $A \in \bigcup_{A \in \mathcal A}A$ : $A \subset V$ and $A \cap V=\emptyset$. The same argument applies for $B \in \bigcup_{A \in \mathcal A}A$ with $B \subset U$ ($A$ and $B$ both nonempty). By hypothesis, $A=A_0$ and $B=A_n$. In this part I got stuck. I know I have to use the fact that the intersection of $A_i$ and $A_{i+1}$ is nonempty and that all the sets in $\mathcal A$ are connected, but I don't know where to use that.
 A: Recall that a (topological or metric) space $X$ is connected if and only if the only continuous functions $f:X\to\{0,1\}$ are the constant functions, where $\{0,1\}$ is endowed with the discrete metric.
Now consider a continuous function $f:\cup\mathcal A\to\{0,1\}$, and prove that this function is constant by using the fact that $f$ restricted to each member of $\mathcal A$ is constant (by connectedness of such members) plus your hypothesis.
A: Assuming $\{A_i : i\in I\}$ are connected and $A=\bigcup_{i\in I}A_i$ disconnected , we have :
$\bigcup_{i\in I}A_i= M\cup N$ where $M$ and $N$ are disjoint open sets in $\bigcup_{i\in I}A_i$
I see that you are familiar with the statement :
for a fixed $i\in I$,  $A_i$ is connected implies  $A_i\subset M$ or $A_i\subset N$ 
as we have supposed $\bigcap_{i\in I}A_i\neq \emptyset$, we have $p\in \bigcap_{i\in I}A_i$.
With out loss of generality, fix $i\in I$ and assume $A_i\subset M$.
Now, for any $j\in I, j\neq i$, suppose $A_j\subset N$ this would imply that :
$p\in A_i$ ($p\in M$) and $p\in A_j$ ($p\in N$) i.e., $p\in M\cap N$
But, we assumed $M\cap N=\emptyset$. 
Thus, we end up with a contradiction when we assume there exists $j\in I$ such that $A_j\subset N$.
So, for any $i\in I$ we have $A_i\subset M$ i.e., $\bigcup_{i\in I}A_i \subset M$ concluding that $N=\emptyset$.
So, there does not exists separation for $\bigcup_{i\in I}A_i$ and thus, it is connected.
A: As in your setup, start from $\bigcup_{A\in\mathcal A}\subseteq U\cup V$ with $U,V$ open and disjoint. Each $A$ is connected, hence is either a subset of $U$ or of $V$. Assume $A\subseteq U$ for some $A$. Pick $B\in \mathcal A$ and a chain $A_i,\ldots, A_n$ as in the condition. 
By induction, $A_i\subseteq U$ for all $i$.
Indeed, this holds for $i=0$ and from $\emptyset \ne A_{i+1}\cap A_i\subseteq U$ we conclude that $A_{i+1}$ intersects $U$ and by connectedness is a subset of $U$.
Thus ultimately $B=A_n\subseteq U$.
Since $B$ was arbitrary, $\bigcup_{A\in\mathcal A}A\subseteq U$ and $V\cap \bigcup_{A\in\mathcal A}A=\emptyset$. Therefore $\bigcup_{A\in\mathcal A}A$ is connected.
