A connected component $C$ of a space $X$ is always closed. This follows from the following fact:
Lemma: If $A$ is a connected subset of a topological space $X$, and $A\subseteq B\subseteq \overline A$, then $B$ is connected as well.
Now if $X$ has only finitely many components, then each component is complement of finitely many closed sets.
Suppose that $C$ is a clopen and non-empty subset of $A:= \bigcup_i A_i$ (i.e. clopen in its subspace topology). We must show $C=A$ for connectedness. Pick $p \in C$ and fix $i_1$ such that $p \in A_{i_1}$.
Because subspace topologies are transitive, $C \cap A_{i_1}$ is clopen in $A_{i_1}$
and non-empty as it still contains $p$. So by connectedness of $A_{i_1}$ we have
$$C\cap A_{i_1} = A_{i_1} \implies A_{i_1} \subseteq C\tag{1}$$
Also, by assumption, $A_0 \cap A_{i_1} \neq \emptyset$, so by $(1)$ we see that $C\cap A_0$ is clopen in $A_0$ and non-empty, as it contains $A_{i_1} \cap A_0$, so again by connectedness of $A_0$:
$$C\cap A_0 = A_0 \implies A_0 \subseteq C\tag{2}$$
Now for an arbitary $i$, $\emptyset \neq A_i \cap A_0 \subseteq A_i \cap C$, the latter set is clopen in $A_i$ so again $A_i \subseteq C$ and as this holds for all $i$, $A \subseteq C$ so $A=C$ and $A$ is connected.
For path connectedness we use the standard composition of paths: if $p_1:[0,1]\to X$ is a path from $x_0$ to $x_1$ and $p_2: [0,1]\to X$ is one from $x_1$ to $x_2$, the map $p_1 \ast p_2: [0,1]\to X$ can be defined as $(p_1 \ast p_2)(t)=p_1(2t)$ for $t \in [0,\frac12]$ and $(p_1 \ast p_2)(t)=p_2(2t-1)$ for $ t \in [\frac12,1]$ and by the pasting lemma $p_1 \ast p_2$ is continuous and a path from $x_0$ to $x_2$. This can be iterated via a third point as well, etc.
Apply this to $A$ for path-connected $A_i$: if $x,y \in A$ so $x \in A_{i_x}$ for some $i_x$ and $y \in A_{i_y}$ for some $i_y$, then fix $x' \in A_0 \cap A_{i_x}$ and $x'' \in A_0 \cap A_{i_y}$ and then combine a path $p_1$ from $x$ to $x'$ (both in the path-connected $A_{i_x}$), a path $p_2$ from $x'$ to $x''$ (both in $A_0$) and $p_3$ from $x''$ to $y$ (both in $A_{i_y}$) to get a path from $x$ to $y$ in $A_{i_x} \cup A_0 \cup A_{i_y} \subseteq A$.
Best Answer
$(\Leftarrow)$: Considering the contrapositive... Let $X$ be a disconnected topological space. That is to say, there exist non-empty open subsets $U$, $V \subset X$ such that $U \cap V = \emptyset $ and $U \cup V=X$. Here $U$ and $V$ are clopen subsets of $X$ since $U^c=V$ and $V^c=U$.
$(\Rightarrow)$: Suppose now that $X$ is connected. Then there exist two clopen subsets of $X$, namely $\emptyset$ and $X$ itself. Here, recall that $\emptyset$ and $X$ are clopen by definition.