About the proof: if $X_i$ is connected, then $\prod_{i\in I} X_i$ is connected. Could someone explain to me why in the following proof $\bigcup Y_F=Y$ (is the bold text)?

$\forall i\in I$, if $X_i$ is connected, then $\prod_{i\in I} X_i$ is connected.

Proof. First prove that any finite product of connected spaces is connected. This can be done by induction on the number of spaces, and for two connected spaces $X$ and $Y$ we see that $X \times Y$ is connected, by observing that $X \times Y = (\cup_{x \in X} (\{x\} \times Y)) \cup X \times \{y_0\}$, where $y_0 \in Y$ is some fixed point. This is connected because every set $\{x\} \times Y$ is homeomorphic to $Y$ (hence connected) and each of them intersects $X \times \{y_0\}$ (in $(x,y_0)$), which is also connected, as it is homeomorphic to $X$. So the union is connected by standard theorems on unions of connected sets. Now finish the induction. So for every finite set $I$, $\prod_{i \in I} X_i$ is connected.
Now if $I$ is infinite, fix points $p_i \in X_i$ for each $i$, and define $$Y = \{ (x_i) \in \prod_i X_i: \{i \in I: x_i \neq p_i \} \text{ is finite }\}$$
Now for each fixed finite subset $F \subset I$, define $Y_F = \{ (x_i) \in \prod_i X_i: \forall i \notin F: x_i = p_i \}$. By the obvious homeomorphism, $Y_F$ is homeomorphic to $\prod_{i \in F} X_i$, which is connected by the first paragraph.So all $Y_F$ are connected, all contain the point $(p_i)_{i \in I}$ of $\prod_{i \in I} X_i$, and their union (over all finite subsets $F$ of $I$) equals $Y$. So again by standard theorems on the union of connected subsets of a space, $Y$ is a connected subspace of $\prod_{i \in I} X_i$.
Finally note that $Y$ is dense in $\prod_{i \in I} X_i$, because every basic open subset $O$ of the product depends on a finite subset of $I$, in the sense that $O = \prod_{i \in I} U_i$ where all $U_i \subset X_i$ are non-empty open and there is some finite subset $F \subset I$ such that $U_i = X_i$ for all $i \notin F$. Pick $q_i \in U_i$ for $i \in F$ and set $q_i = p_i $ for $i \notin F$. The $(q_i)_{i \in I}$ is in $O \cap Y_F \subset O \cap Y$, so every (basic) open subset of $\prod_{i \in I} X_i$ intersects $Y$. 
Now use that the closure of a connected set is connected to conclude that $\prod_{i \in I} X_i$ is connected, also for infinite $I$.

This proof was made by Henno here Connected topological spaces, product is connected . I already asked Henno but I got more confused.
 A: It's really quite clear, I think: $Y$ is the set of points with a finite set of indices where it differs from $p$, the point of $\prod_i X_i$ that we fixed in advance. (We might as well assume $\prod_i X_i$ is non-empty, otherwise it would be empty, thus connected and there would be nothing to prove). Call $\{i \in I: x_i \neq p_i \}$ the exception set of $x$, say $E(x)$. 
This $E(x)$ is defined for all points of the product of course, but we are only interested in the (dense) set of points $Y$ that have a finite exception set $E(x)$.
We can also find these as follows: fix the finite difference set $F \subseteq I$ an consider only those points $Y_F$ that exactly have an exception set that is a subset of $F$ (we allow $x_i = p_i$ for $i \in F$ as well, so that $Y_F$ is exactly a product of singletons $\{p_i\}$ for $i \notin F$ and $X_i$ for $i \in F$) and the finite case tells us then that $Y_F$ is connected. As any $x \in Y_F$ has a finite exception set (namely $F$ or a subset of it, note that $E(p) = \emptyset$ e.g. so that $p \in Y_F$ for all $F$), $Y_F \subseteq Y$. But if $x \in Y$ it has a finite exception set $E(x)$ and thus $x \in Y_{E(x)}$ by definition. So we can take $F= E(x)$ to see $x \in Y_F$ and so $Y = \bigcup\{Y_F: F \subseteq I, F \text{ finite }\}$.  
A: For any $x=(x_i)\in \prod X_i$, let $S(x)=\{i\in I:x_i\neq p_i\}$.  If $x\in Y_F$ for some finite $F$, then $S(x)\subseteq F$, so in particular $S(x)$ is finite.  This means $x\in Y$.  Thus $Y_F\subseteq Y$ for any $F$, and so $\bigcup Y_F\subseteq Y$.
Conversely, if $x\in Y$, then $S(x)$ is finite and $x\in Y_{S(x)}$, so $x\in \bigcup Y_F$.
