[example: The Topologist's Sine Curve]
Let
\begin{align*}
S=\{(x,\sin(1/x)):0<x\le 1\}\subset \mathbb R^2.
\end{align*}
The map $f:(0,1]\to \mathbb R^2$ given by $f(x)=(x,\sin(1/x))$ is continuous, and $(0,1]$ is connected, so $S=f((0,1])$ is connected by *Continuous Image of a [Connected Space](/page/Connected%20Space)*. Now define
\begin{align*}
T=\overline{S}=S\cup(\{0\}\times[-1,1]).
\end{align*}
The equality holds because if $y\in[-1,1]$, choose $\theta\in \mathbb R$ with $\sin \theta=y$, and choose integers $k$ so large that $\theta+2\pi k>1$; then $x_k=1/(\theta+2\pi k)$ satisfies $x_k\to 0$ and
\begin{align*}
(x_k,\sin(1/x_k))=(x_k,\sin(\theta+2\pi k))=(x_k,y)\to(0,y).
\end{align*}
Conversely, every [limit point](/page/Limit%20Point) of $S$ with first coordinate $0$ has second coordinate in $[-1,1]$, because $\sin(1/x)\in[-1,1]$ for every $x>0$. Hence $T$ is the closure of the connected set $S$, so $T$ is connected by *[Closure of a Connected Set Is Connected](/theorems/297)*.
We show that $T$ is not path-connected by proving that no path can join the vertical segment $\{0\}\times[-1,1]$ to the oscillating graph $S$. Suppose, toward a contradiction, that $\gamma:[0,1]\to T$ is such a path, oriented so that $\gamma(0)\in\{0\}\times[-1,1]$ and $\gamma(1)\in S$. Write $\gamma(t)=(u(t),v(t))$. The coordinate functions $u$ and $v$ are continuous because they are compositions of $\gamma$ with the two coordinate projections.
Let
\begin{align*}
A=\{t\in[0,1]:u(t)=0\}.
\end{align*}
Then $A=u^{-1}(\{0\})$ is closed, $0\in A$, and $1\notin A$ because $\gamma(1)\in S$ has positive first coordinate. Set $a=\sup A$. Since $A$ is closed in $[0,1]$, we have $a\in A$, so $u(a)=0$; also $a<1$. If $t>a$, then $t\notin A$ by the definition of supremum, and since every point of $T$ has nonnegative first coordinate, $u(t)>0$. Therefore, for every $t\in(a,1]$, the point $\gamma(t)$ lies in $S$, and so
\begin{align*}
v(t)=\sin(1/u(t)).
\end{align*}
Fix any $b$ with $a<b\le 1$. Since $u(b)>0$ and $u$ is continuous on $[a,b]$, the intermediate value property gives, for every $r\in(0,u(b))$, some $t_r\in(a,b)$ such that $u(t_r)=r$. Choose $k$ large enough that
\begin{align*}
0<\frac{1}{\pi/2+2\pi k}<u(b).
\end{align*}
For the corresponding $t_k^+\in(a,b)$ with $u(t_k^+)=1/(\pi/2+2\pi k)$, we get
\begin{align*}
v(t_k^+)=\sin(1/u(t_k^+))=\sin(\pi/2+2\pi k)=1.
\end{align*}
Choose $k$ large enough that
\begin{align*}
0<\frac{1}{3\pi/2+2\pi k}<u(b).
\end{align*}
For the corresponding $t_k^-\in(a,b)$ with $u(t_k^-)=1/(3\pi/2+2\pi k)$, we get
\begin{align*}
v(t_k^-)=\sin(1/u(t_k^-))=\sin(3\pi/2+2\pi k)=-1.
\end{align*}
Thus every interval $(a,b)$ contains points where $v=1$ and points where $v=-1$.
This contradicts continuity of $v$ at $a$. Indeed, $v(a)\in[-1,1]$, so at least one of $|1-v(a)|$ and $|-1-v(a)|$ is at least $1$. But continuity at $a$ with $\varepsilon=1/2$ would give a right-neighbourhood of $a$ on which all values of $v$ lie within $1/2$ of $v(a)$, while every such neighbourhood contains a point with $v=1$ and a point with $v=-1$. Hence no such path exists. The space $T$ is therefore connected, but not path-connected.
[/example]