[proofplan]
The direction "path-connected implies connected" holds in any topological space. For the converse, we fix a point $x_0 \in U$ and define $P$ to be its path-connected component in $U$. We show $P$ is simultaneously open and closed in $U$ by exploiting the openness of $U$ in $\mathbb{R}^n$: every point of $U$ has a ball neighbourhood in which any two points are joined by a line segment. Since $U$ is connected and $P$ is non-empty, $P = U$.
[/proofplan]
[step:Observe that path-connectedness implies connectedness in any topological space]
If $U$ is path-connected, then $U$ is connected. This holds in any [topological](/page/Topology) space: if $U = A \cup B$ with $A, B$ disjoint, non-empty, and open, pick $a \in A$ and $b \in B$. A path $\gamma: [0,1] \to U$ from $a$ to $b$ has $\gamma^{-1}(A)$ and $\gamma^{-1}(B)$ forming a separation of $[0,1]$, contradicting the connectedness of $[0,1]$.
[guided]
We first handle the easier direction: path-connected implies connected. This holds without any assumption on $U$ beyond it being a topological space.
Suppose $U$ is path-connected and, for contradiction, that $U = A \cup B$ where $A$ and $B$ are disjoint, non-empty, and open in $U$. Pick $a \in A$ and $b \in B$.
By path-connectedness, there exists a continuous map $\gamma: [0,1] \to U$ with $\gamma(0) = a$ and $\gamma(1) = b$. Consider the preimages $\gamma^{-1}(A)$ and $\gamma^{-1}(B)$.
These are open in $[0,1]$ (because $\gamma$ is continuous and $A, B$ are open in $U$), disjoint (since $A \cap B = \varnothing$), non-empty (since $0 \in \gamma^{-1}(A)$ and $1 \in \gamma^{-1}(B)$), and their union is $\gamma^{-1}(A \cup B) = \gamma^{-1}(U) = [0,1]$.
This is a separation of $[0,1]$ into two disjoint non-empty open sets, contradicting the fact that $[0,1]$ is connected (as an interval in $\mathbb{R}$). Therefore no such separation of $U$ exists, and $U$ is connected.
[/guided]
[/step]
[step:Define the path-connected component $P$ of a fixed point $x_0 \in U$]
Assume $U$ is connected. Fix $x_0 \in U$ and define
\begin{align*}
P = \{x \in U : \text{there exists a continuous path in } U \text{ from } x_0 \text{ to } x\}.
\end{align*}
The set $P$ is non-empty since $x_0 \in P$ (the constant path witnesses this). We show $P$ is both open and closed in $U$.
[/step]
[step:Show $P$ is open in $U$ using ball neighbourhoods]
Let $x \in P$. Since $U$ is open in $\mathbb{R}^n$, there exists $r > 0$ with $B(x, r) \subseteq U$. For any $y \in B(x, r)$, define the line-segment path $\gamma: [0,1] \to \mathbb{R}^n$ by $\gamma(t) = (1-t)x + ty$. Since $B(x, r)$ is convex, $\gamma(t) \in B(x, r) \subseteq U$ for all $t \in [0,1]$. Concatenating a path from $x_0$ to $x$ (which exists because $x \in P$) with $\gamma$ yields a path from $x_0$ to $y$ lying in $U$. Therefore $y \in P$, and since $y$ was arbitrary, $B(x, r) \subseteq P$. This shows $P$ is open.
[guided]
Why does openness of $U$ matter here? The point is that we need to connect nearby points by paths. In an arbitrary topological space, a point $x$ might have no "convex" neighbourhood, so path-connected components of an open set need not be open. In $\mathbb{R}^n$, openness of $U$ guarantees that every $x \in U$ sits inside a ball $B(x, r) \subseteq U$, and balls in $\mathbb{R}^n$ are convex: for any $y \in B(x, r)$, the line segment
\begin{align*}
\gamma: [0,1] &\to \mathbb{R}^n, \quad t \mapsto (1-t)x + ty
\end{align*}
satisfies $\|\gamma(t) - x\| = t\|y - x\| < t \cdot r \leq r$, so $\gamma([0,1]) \subseteq B(x, r) \subseteq U$. Now if $x \in P$, there exists a continuous path $\alpha: [0,1] \to U$ with $\alpha(0) = x_0$ and $\alpha(1) = x$. For any $y \in B(x, r)$, the concatenation of $\alpha$ with $\gamma$ is a continuous path in $U$ from $x_0$ to $y$. (The concatenation is continuous because both pieces agree at the junction point $x$.) Therefore $y \in P$. Since this holds for every $y \in B(x, r)$, we have $B(x, r) \subseteq P$, proving $P$ is open.
[/guided]
[/step]
[step:Show $U \setminus P$ is open in $U$, so $P$ is closed in $U$]
Let $x \in U \setminus P$. Since $U$ is open, there exists $r > 0$ with $B(x, r) \subseteq U$. Suppose some $y \in B(x, r)$ belonged to $P$. Then there would exist a path from $x_0$ to $y$ in $U$. Concatenating with the line segment from $y$ to $x$ (which lies in $B(x, r) \subseteq U$ by convexity) would give a path from $x_0$ to $x$ in $U$, contradicting $x \notin P$. Therefore $B(x, r) \cap P = \varnothing$, i.e., $B(x, r) \subseteq U \setminus P$. This shows $U \setminus P$ is open in $U$, hence $P$ is closed in $U$.
[guided]
We use the exact same ball-and-line-segment argument, but now applied in reverse to show $U \setminus P$ is open.
Let $x \in U \setminus P$. Since $U$ is open in $\mathbb{R}^n$, there exists $r > 0$ with $B(x, r) \subseteq U$. We claim that $B(x, r) \cap P = \varnothing$.
Suppose for contradiction that some $y \in B(x, r) \cap P$ exists. Since $y \in P$, there is a continuous path $\alpha: [0,1] \to U$ from $x_0$ to $y$. The ball $B(x, r)$ is convex, so the line segment from $y$ to $x$ lies entirely in $B(x, r) \subseteq U$.
Concatenating $\alpha$ with this line segment produces a continuous path from $x_0$ to $x$ lying in $U$. This would mean $x \in P$, contradicting $x \in U \setminus P$.
Therefore $B(x, r) \cap P = \varnothing$, i.e., $B(x, r) \subseteq U \setminus P$. Since $x \in U \setminus P$ was arbitrary, $U \setminus P$ is open in $U$. Equivalently, $P$ is closed in $U$.
[/guided]
[/step]
[step:Conclude $P = U$ by connectedness]
The set $P$ is non-empty (since $x_0 \in P$), open in $U$, and closed in $U$. Since $U$ is connected, the only non-empty subset that is both open and closed in $U$ is $U$ itself. Therefore $P = U$. This means every point of $U$ can be connected to $x_0$ by a path in $U$, so $U$ is path-connected.
[/step]