Let $X_{1},\dots X_{m}$ a finite collection of subsets of a metric space $M$ such that $X_{n}\cap X_{n+1}\neq \emptyset$ for all $n$. Show that $X=\cup X_{n}$ is connected.
How can I prove that?
I tried to do the contrapositive: If $X=\cup X_{n}$ is not connected, exists $1\leq n < m$ such that $X_{n}\cap X_{n+1}=\emptyset$, but I didn't work. Can someone give me any some tips?
As mentioned, the result is false unless each space $X_n$ is connected so let's assume so.
Here is an alternative approach: a metric space $(Y,d)$ is connected if and only if any continuous function $Y \to \{0,1\}$ is constant. If you had a non-constant function, preimages of $0$ and $1$ would disconnect $Y$. Reciprocally, if $Y$ can be disconnected, sending one open set to $0$ and the other one to $1$ gives a continuous function.
Let $z_n \in X_n \cap X_{n+1}$ for each $n$. To show that $\bigcup_n X_n$ is connected, let $\varphi: \bigcup_n X_n \to \{0,1\}$ continuous and let's see that $\varphi$ is constant. Since each $X_n$ is connected, the restriction $\varphi_n = \varphi|_{X_n} : X_n \to \{0,1\}$ ought to be constant, i.e. $\varphi_n \equiv c_n \in \{0,1\}$. Now, it suffices to see that $c_n \equiv c_1$ for all $n$. We proceed by induction: the base case is trivial. As for the inductive step,
$$ c_{n+1} = \varphi_{n+1}(z_n) = \varphi_n(z_n) = c_n \stackrel{I.H.}{=} c_1, $$
and so we are done.