[proofplan]
We show path-[connectedness](/page/Connectedness) implies connectedness using the characterisation from the [equivalent characterisations of connectedness](/theorems/294): it suffices to show every continuous [function](/page/Function) $f: X \to \mathbb{Z}$ is constant. Given any $x \in X$, a path from a base point $x_0$ to $x$ composes with $f$ to give a continuous map $[0,1] \to \mathbb{Z}$, which must be constant since $[0,1]$ is connected. For the failure of the converse, the topologist's sine curve provides a connected but non-path-connected counterexample.
[/proofplan]
[step:Prove that path-connectedness implies connectedness via the $\mathbb{Z}$-valued function criterion]
Suppose $X$ is path-connected and let $f: X \to \mathbb{Z}$ be continuous (where $\mathbb{Z}$ carries the discrete [topology](/page/Topology)). Fix $x_0 \in X$ and let $x \in X$ be arbitrary. By path-connectedness, there exists a continuous path $\gamma: [0,1] \to X$ with $\gamma(0) = x_0$ and $\gamma(1) = x$.
The composition $f \circ \gamma: [0,1] \to \mathbb{Z}$ is continuous. Since $[0,1]$ is an interval, it is connected (by the [connected subsets of the real line](/theorems/295) characterisation). By the [equivalent characterisations of connectedness](/theorems/294) (condition (3)), $f \circ \gamma$ is constant. In particular,
\begin{align*}
f(x) = f(\gamma(1)) = f(\gamma(0)) = f(x_0).
\end{align*}
Since $x \in X$ was arbitrary, $f$ is constant on $X$. By the [equivalent characterisations of connectedness](/theorems/294) (condition (3) $\Rightarrow$ condition (1)), $X$ is connected.
[guided]
The proof routes through the $\mathbb{Z}$-valued function characterisation of connectedness. The key insight is that a path $\gamma: [0,1] \to X$ converts a spatial connectedness question into a one-dimensional one.
Given $f: X \to \mathbb{Z}$ continuous, we want to show $f$ is constant. Fix a base point $x_0$ and an arbitrary point $x$. Path-connectedness gives a continuous path $\gamma$ from $x_0$ to $x$. The composition $f \circ \gamma: [0,1] \to \mathbb{Z}$ is continuous, and $[0,1]$ is connected (it is an interval, and all intervals in $\mathbb{R}$ are connected). A continuous function from a connected space to $\mathbb{Z}$ is constant, so $f \circ \gamma$ takes the same value at $0$ and $1$:
\begin{align*}
f(x) = f(\gamma(1)) = f(\gamma(0)) = f(x_0).
\end{align*}
Since $x$ was arbitrary, $f$ is constant on all of $X$.
Why does the converse fail? Path-connectedness is strictly stronger than connectedness because it requires the existence of continuous curves, not just the absence of disconnections. A connected space can have points that are "topologically close" (no open-set separation) but "metrically inaccessible by paths."
[/guided]
[/step]
[step:Exhibit the topologist's sine curve as a connected but non-path-connected space]
Define $S = \{(x, \sin(1/x)) : x \in (0, 1]\} \cup \{0\} \times [-1, 1]$. The graph $G = \{(x, \sin(1/x)) : x \in (0, 1]\}$ is the continuous image of the connected interval $(0, 1]$ under $x \mapsto (x, \sin(1/x))$, hence connected. Since $S$ lies between $G$ and its [closure](/page/Closure) $\overline{G}$ (the closure includes the vertical segment $\{0\} \times [-1,1]$ because $\sin(1/x)$ takes every value in $[-1,1]$ on every interval $(0, \delta)$), $S$ is connected by the [closure of a connected set](/theorems/297) result.
However, $S$ is not path-connected. Suppose $\gamma: [0,1] \to S$ is a continuous path with $\gamma(0) = (0, 0)$ and $\gamma(1) = (1, \sin 1)$. Write $\gamma(t) = (\gamma_1(t), \gamma_2(t))$ for the coordinate functions. Since $\gamma_1$ is continuous, $\gamma_1(0) = 0$, and $\gamma_1(1) = 1 > 0$, let $t_0 = \inf\{t \in [0,1] : \gamma_1(t) > 0\}$. For $t > t_0$ close to $t_0$, the first coordinate $\gamma_1(t) > 0$ is small and $\gamma_2(t) = \sin(1/\gamma_1(t))$ oscillates between $-1$ and $1$ as $\gamma_1(t) \to 0^+$. But $\gamma_2$ must be continuous at $t_0$, requiring $\gamma_2(t) \to \gamma_2(t_0)$ — contradicting the unbounded oscillation of $\sin(1/\gamma_1(t))$. Therefore no such path exists.
[/step]