[example: The Topologist's Sine Curve]
Let
\begin{align*}
S=\{(x,\sin(1/x)):0<x\le 1\}\cup(\{0\}\times[-1,1])\subsetneq\mathbb{R}^2.
\end{align*}
Let $G=\{(x,\sin(1/x)):0<x\le 1\}$. 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 $G=f((0,1])$ is connected by *Continuous Images of Connected Sets are Connected*. Also $\overline{G}=S$: if $y\in[-1,1]$, choose $\theta\in[-\pi/2,\pi/2]$ with $\sin\theta=y$ and set $x_n=(\theta+2\pi n)^{-1}$ for all large $n$ for which the denominator is positive. Then $x_n\to 0$ and
\begin{align*}
(x_n,\sin(1/x_n))=\left((\theta+2\pi n)^{-1},\sin(\theta+2\pi n)\right)=\left((\theta+2\pi n)^{-1},y\right)\to(0,y).
\end{align*}
Conversely, every [limit point](/page/Limit%20Point) of $G$ either has first coordinate $x>0$, in which case continuity of $x\mapsto\sin(1/x)$ puts it back on the graph, or has first coordinate $0$ and second coordinate in $[-1,1]$. Hence $S=\overline{G}$, so $S$ is connected by *Closures of Connected Sets are Connected*.
We show that $S$ is not path connected. Suppose, for contradiction, that $\gamma:[0,1]\to S$ is a path starting on the vertical segment and later reaching the oscillating graph. Write
\begin{align*}
\gamma(t)=(u(t),v(t)).
\end{align*}
Then $u$ and $v$ are continuous, $u(0)=0$, and $u(b)>0$ for some $b\in[0,1]$. Let $C$ be the [connected component](/page/Connected%20Component) of $\{t\in[0,1]:u(t)>0\}$ containing $b$, and let $a$ be the left endpoint of $C$. Since $\{u>0\}$ is open in $[0,1]$, we have $u(t)>0$ for $t\in(a,c)$ for some $c>a$, and continuity gives $u(a)=0$. For every $t\in(a,c)$, the point $\gamma(t)$ lies on the graph part of $S$, so
\begin{align*}
v(t)=\sin(1/u(t)).
\end{align*}
Choose $t_n\in(a,c)$ with $t_n\downarrow a$. Since $u(a)=0$ and $u(t_n)>0$, the [intermediate value theorem](/theorems/180) applied to $u$ on $[a,t_n]$ shows that $u$ takes every value between $0$ and $u(t_n)$. Pick integers $k_n$ so large that
\begin{align*}
0<\frac{1}{\pi/2+2\pi k_n}<u(t_n)\quad\text{and}\quad 0<\frac{1}{3\pi/2+2\pi k_n}<u(t_n).
\end{align*}
Thus there exist $\alpha_n,\beta_n\in(a,t_n)$ such that
\begin{align*}
u(\alpha_n)=\frac{1}{\pi/2+2\pi k_n}
\end{align*}
and
\begin{align*}
u(\beta_n)=\frac{1}{3\pi/2+2\pi k_n}.
\end{align*}
Because $a<\alpha_n,\beta_n<t_n$ and $t_n\downarrow a$, both $\alpha_n\to a$ and $\beta_n\to a$. On the graph,
\begin{align*}
v(\alpha_n)=\sin(\pi/2+2\pi k_n)=1
\end{align*}
and
\begin{align*}
v(\beta_n)=\sin(3\pi/2+2\pi k_n)=-1.
\end{align*}
Continuity of $v$ at $a$ would force $v(\alpha_n)\to v(a)$ and $v(\beta_n)\to v(a)$, so $v(a)=1$ and $v(a)=-1$, a contradiction. Therefore no path can join a point of the vertical segment to a point of the oscillating graph, and $S$ is connected but not path connected.
[/example]