[proofplan]
We define the path relation on $X$ by declaring two points equivalent when they can be joined by a continuous path in $X$. The main work is to verify directly that this relation is reflexive, symmetric, and transitive, using constant paths, reversed paths, and concatenated paths. Once this is an [equivalence relation](/page/Equivalence%20Relation), its equivalence classes automatically form a partition of $X$; the remaining assertions follow by unpacking the definition of those classes and comparing paths inside a subset with paths inside the ambient space.
[/proofplan]
[step:Define the path relation on $X$]
Define a binary relation $\sim$ on $X$ as follows: for $x,y\in X$, write $x\sim y$ if there exists a continuous map
\begin{align*}
\gamma:[0,1]\to X
\end{align*}
such that $\gamma(0)=x$ and $\gamma(1)=y$. Here $[0,1]$ is equipped with the [subspace topology](/page/Subspace%20Topology) inherited from $\mathbb{R}$.
We will prove that $\sim$ is an equivalence relation. Its equivalence classes will then be precisely the path components of $X$ under the definition in the statement.
[/step]
[step:Prove reflexivity by using constant paths]
Let $x\in X$. Define the constant map
\begin{align*}
c_x:[0,1]\to X,\qquad t\mapsto x.
\end{align*}
For every [open set](/page/Open%20Set) $O\in\tau$, the preimage $c_x^{-1}(O)$ is either $[0,1]$ if $x\in O$, or $\varnothing$ if $x\notin O$. Both sets are open in the subspace topology on $[0,1]$, so $c_x$ is continuous. Since $c_x(0)=x$ and $c_x(1)=x$, we have $x\sim x$. Thus $\sim$ is reflexive.
[/step]
[step:Prove symmetry by reversing paths]
Let $x,y\in X$ and suppose $x\sim y$. Choose a continuous map
\begin{align*}
\gamma:[0,1]\to X
\end{align*}
such that $\gamma(0)=x$ and $\gamma(1)=y$.
Define the reversal map
\begin{align*}
\rho:[0,1]\to[0,1],\qquad t\mapsto 1-t.
\end{align*}
The map $\rho$ is continuous as the restriction of the continuous affine map $\mathbb{R}\to\mathbb{R}$, $t\mapsto 1-t$, to $[0,1]$. Define
\begin{align*}
\bar{\gamma}:[0,1]\to X,\qquad t\mapsto \gamma(\rho(t)).
\end{align*}
Since $\bar{\gamma}=\gamma\circ\rho$, it is continuous as a [composition of continuous maps](/theorems/4960). Moreover,
\begin{align*}
\bar{\gamma}(0)=\gamma(1)=y
\end{align*}
and
\begin{align*}
\bar{\gamma}(1)=\gamma(0)=x.
\end{align*}
Therefore $y\sim x$. Thus $\sim$ is symmetric.
[/step]
[step:Prove transitivity by concatenating paths]
Let $x,y,z\in X$ and suppose $x\sim y$ and $y\sim z$. Choose continuous maps
\begin{align*}
\gamma:[0,1]\to X
\end{align*}
and
\begin{align*}
\eta:[0,1]\to X
\end{align*}
such that $\gamma(0)=x$, $\gamma(1)=y$, $\eta(0)=y$, and $\eta(1)=z$.
Define the concatenated map $\alpha:[0,1]\to X$ by setting $\alpha(t)=\gamma(2t)$ for $0\leq t\leq \frac{1}{2}$ and $\alpha(t)=\eta(2t-1)$ for $\frac{1}{2}\leq t\leq 1$.
The two formulas agree at $t=\frac{1}{2}$ because
\begin{align*}
\gamma(1)=y=\eta(0).
\end{align*}
Let
\begin{align*}
I_0:=\left[0,\frac{1}{2}\right]
\end{align*}
and
\begin{align*}
I_1:=\left[\frac{1}{2},1\right].
\end{align*}
The sets $I_0$ and $I_1$ are closed in $[0,1]$ and satisfy $[0,1]=I_0\cup I_1$. The restriction $\alpha|_{I_0}$ is the composition of $\gamma$ with the continuous map $I_0\to[0,1]$, $t\mapsto 2t$. The restriction $\alpha|_{I_1}$ is the composition of $\eta$ with the continuous map $I_1\to[0,1]$, $t\mapsto 2t-1$. Hence both restrictions are continuous, and because the two formulas agree on $I_0\cap I_1$, the map $\alpha$ is continuous on $[0,1]$.
Finally,
\begin{align*}
\alpha(0)=\gamma(0)=x
\end{align*}
and
\begin{align*}
\alpha(1)=\eta(1)=z.
\end{align*}
Thus $x\sim z$, so $\sim$ is transitive.
[guided]
The goal is to build one path from $x$ to $z$ out of a path from $x$ to $y$ and a path from $y$ to $z$. Since both paths are defined on the same interval $[0,1]$, we put the first path on the first half of the interval and the second path on the second half.
Let
\begin{align*}
\gamma:[0,1]\to X
\end{align*}
be a continuous path with $\gamma(0)=x$ and $\gamma(1)=y$, and let
\begin{align*}
\eta:[0,1]\to X
\end{align*}
be a continuous path with $\eta(0)=y$ and $\eta(1)=z$. Define
\begin{align*}
\alpha:[0,1]&\to X
\end{align*}
by $\alpha(t)=\gamma(2t)$ for $0\leq t\leq \frac{1}{2}$ and $\alpha(t)=\eta(2t-1)$ for $\frac{1}{2}\leq t\leq 1$.
The only possible difficulty is continuity at the joining time $t=\frac{1}{2}$. At that time the first formula gives
\begin{align*}
\gamma(2\cdot \frac{1}{2})=\gamma(1)=y,
\end{align*}
while the second formula gives
\begin{align*}
\eta(2\cdot \frac{1}{2}-1)=\eta(0)=y.
\end{align*}
Thus the two pieces agree at the overlap.
Now define
\begin{align*}
I_0:=\left[0,\frac{1}{2}\right]
\end{align*}
and
\begin{align*}
I_1:=\left[\frac{1}{2},1\right].
\end{align*}
These are closed subsets of $[0,1]$ and cover $[0,1]$. On $I_0$, the map $\alpha$ is the composition of $\gamma$ with the continuous affine map $t\mapsto 2t$ from $I_0$ to $[0,1]$. On $I_1$, the map $\alpha$ is the composition of $\eta$ with the continuous affine map $t\mapsto 2t-1$ from $I_1$ to $[0,1]$. Therefore both restrictions are continuous, and since they agree on $I_0\cap I_1$, the glued map $\alpha$ is continuous on all of $[0,1]$.
The endpoints are
\begin{align*}
\alpha(0)=\gamma(0)=x
\end{align*}
and
\begin{align*}
\alpha(1)=\eta(1)=z.
\end{align*}
So $\alpha$ is a continuous path from $x$ to $z$, which proves $x\sim z$. This is exactly the transitivity of the path relation.
[/guided]
[/step]
[step:Conclude that the equivalence classes form a partition]
By the preceding steps, $\sim$ is an equivalence relation on $X$. For each $x\in X$, define the equivalence class
\begin{align*}
C_x:=\{y\in X:y\sim x\}.
\end{align*}
Every point $x\in X$ belongs to $C_x$ by reflexivity, so the union of all classes is $X$. If two classes $C_x$ and $C_y$ intersect, choose $w\in C_x\cap C_y$. Then $w\sim x$ and $w\sim y$. By symmetry and transitivity, $x\sim y$. Hence for every $u\in C_x$, transitivity gives $u\sim y$, so $u\in C_y$; thus $C_x\subset C_y$. The same argument with $x$ and $y$ exchanged gives $C_y\subset C_x$. Therefore $C_x=C_y$.
It follows that distinct equivalence classes are disjoint and that their union is $X$. Hence the path components form a partition of $X$.
[/step]
[step:Show that each path component is path connected]
Let $C$ be a path component of $X$. Then $C=C_x$ for some $x\in X$, where
\begin{align*} C_x:=\{y\in X:y\sim x\}. \end{align*}
Let $u,v\in C$. Since $u\in C_x$ and $v\in C_x$, we have $u\sim x$ and $v\sim x$. By symmetry, $x\sim v$, and by transitivity, $u\sim v$. Therefore there exists a continuous map
\begin{align*} \gamma:[0,1]\to X \end{align*}
such that $\gamma(0)=u$ and $\gamma(1)=v$.
To see that the image of $\gamma$ lies in $C$, fix $t\in[0,1]$. The reparametrized map
\begin{align*} \gamma_t:[0,1]\to X, \qquad s\mapsto \gamma(ts) \end{align*}
is continuous, satisfies $\gamma_t(0)=u$, and satisfies $\gamma_t(1)=\gamma(t)$. Hence $u\sim\gamma(t)$. By symmetry, $\gamma(t)\sim u$, and since $u\sim x$, transitivity gives $\gamma(t)\sim x$. Therefore $\gamma(t)\in C_x=C$ for every $t\in[0,1]$.
Since $\gamma([0,1])\subset C$ and $C$ has the subspace topology, the corestriction
\begin{align*} \gamma:[0,1]\to C \end{align*}
is continuous. Thus $\gamma$ is a path in $C$ from $u$ to $v$, and $C$ is path connected.
[/step]
[step:Contain every path connected subset in the component of any of its points]
Let $A\subset X$ be path connected, and let $a\in A$. We prove that $A\subset C_a$, where
\begin{align*}
C_a:=\{x\in X:x\sim a\}
\end{align*}
is the path component of $X$ containing $a$.
Let $b\in A$. Since $A$ is path connected, there exists a continuous map
\begin{align*}
\gamma:[0,1]\to A
\end{align*}
such that $\gamma(0)=a$ and $\gamma(1)=b$, where $A$ has the subspace topology inherited from $X$. Let
\begin{align*}
\iota_A:A\to X
\end{align*}
denote the inclusion map. The inclusion map is continuous by the definition of the subspace topology, so
\begin{align*}
\iota_A\circ\gamma:[0,1]\to X
\end{align*}
is continuous. It satisfies
\begin{align*}
(\iota_A\circ\gamma)(0)=a
\end{align*}
and
\begin{align*}
(\iota_A\circ\gamma)(1)=b.
\end{align*}
Therefore $b\sim a$, so $b\in C_a$. Since $b\in A$ was arbitrary, $A\subset C_a$.
If $A=\varnothing$, the assertion in the formal statement is vacuous because there is no $a\in A$ to choose. This completes the proof.
[/step]