$M = \prod_{i=1}^{\infty} M_i$ is connected if and only if each factor $M_i$ is connected. 
Let $(M_i)$ be a countable family of non-empty metric spaces and consider $M = \prod_{i=1}^{\infty} M_i$. Suppose that for each $i\in \mathbb{N}$ exists a constant $c_i>0$ such that the series $\sum_{i=1}^{\infty} c_i$ is convegent and $d_i(x_i,y_i)\leq c_i$ for any $x_i,y_i\in M_i$. We define a metric in $M$ by: $d(x,y)= \sum_{i=1}^{\infty} d_i(x_i,y_i),$where $x=(x_i),y=(y_i)\in M.$
Prove that $M = \prod_{i=1}^{\infty} M_i$ is connected if and only if each factor $M_i$ is connected.

I think that i could manage to prove the $\implies$ part: for each $i\in \mathbb{N}$, define the projection $p_i: (M,d)\rightarrow (M_i,d_i)$ by $p_i(x)=x_i$ which associates each $x\in M$ to its coordinate in $M_i$. By the way the metric $d$ was defined above, each $p_i$ is Lipschitz continuous, and therefore, continuous. Supposing that $M$ is connected, since $p_i$ is clearly surjective, it follows by continuity that $M_i$ is also connected, for each $i\in \mathbb{N}$.
But i'm struggling to prove the other part. So i have two requests: do you think that the first part is alright? And can you give help to prove the second part? 
 A: Yes, the first part is correct.
For the second part, suppose that each $M_i$ is connected. In order to prove that $\prod_{i\in\mathbb N}M_i$ is connected, I shall consider a continuous function $f\colon\prod_{i\in\mathbb N}M_i\longrightarrow\{0,1\}$ (with $\{0,1\}$ endowed with its usual topology) and I shall prove that $f$ is constant. Let $(a_i)_{i\in\mathbb N}$ be an element of $\prod_{i\in\mathbb N}M_i$. For each $i\in\mathbb N$, consider the function $\iota_i\colon M_i\longrightarrow\prod_{i\in\mathbb N}M_i$ thus defined:$$\bigl(\iota_i(m)\bigr)_j=\begin{cases}m&\text{ if }j=i\\a_j&\text{ otherwise.}\end{cases}$$Then each $\iota_i$ is continuous and so $f\circ\iota_i$ is continuous too. Since $M_i$ is connected, $f\circ\iota_i$ is constant. This proves that if $(x_i)_{i\in\mathbb N}\neq(a_i)_{i\in\mathbb N}$ and $x_i\neq a_i$ for a single $i$, then $f\bigl((x_i)_{i\in\mathbb N}\bigr)=f\bigl((a_i)_{i\in\mathbb N}\bigr)$. It can be now proved by induction that if $(x_i)_{i\in\mathbb N}\neq(a_i)_{i\in\mathbb N}$ and $x_i\neq a_i$ for finitely many $i$'s only, then $f\bigl((x_i)_{i\in\mathbb N}\bigr)=f\bigl((a_i)_{i\in\mathbb N}\bigr)$. But these elements of $\prod_{i\in\mathbb N}M_i$ (that is, those $(x_i)_{i\in\mathbb N}$ such that $(x_i)_{i\in\mathbb N}\neq(a_i)_{i\in\mathbb N}$ and $x_i\neq a_i$ for finitely many indexes $i$ only) form a dense set in $\prod_{i\in\mathbb N}M_i$. Since $f$ is continuous, this proves that it is constant.
A: Hint for showing $\prod_{i=1}^\infty M_i$ is connected if each $M_i$ is: suppose $A \subseteq \prod_{i=1}^\infty M_i$ is clopen and nonempty, with $x = (x_1, x_2, x_3, \ldots) \in A$.  Then show for each $y_1 \in M_1$, $(y_1, x_2, x_3, \ldots) \in A$; use that to show for each $y_2 \in M_2$, $(y_1, y_2, x_3, \ldots) \in A$; and so on.  Finally, show that $\{ y \in \prod_{i=1}^\infty M_i : \exists i_0, \forall i > i_0, x_i = y_i \}$ is dense in the product.
