Show that $S:= \{ x+iy \;|\; x = 0 \text{ or } x>0 , y = \sin(\frac{1}{x}) \} $ is connected, even though there are points in $S$ that cannot be connected by any curve in $S$
Attempt: Suppose $S$ is disconnected. By definition there exists two disjoint sets $A$ and $B$ such that $S$ is contained in $A \cup B$ and $S$ is not contained in neither $A$ nor $B$.
This is where I'm stuck. Somehow I have to arrive at a contradiction or show that no such sets $A, B$ exist but don't know how to proceed. Any help would be greatly appreciated.
I think you are looking for Topologist's sine curve, and trying to prove that it is connected. Here is a way that may help you.
Define, $X\subset \mathbb{R}^2$ by, $X=\{(0,0)\}\cup B$ where $B=\{(x,y):0<x<1,y=\sin(\frac{\pi}{x})\}$.
Clearly, the set $B$ is the graph of the function, $f:(0,1]\to \mathbb{R}^2$ defined by, $f(x)=(x,\sin (\frac{\pi}{x}))$.
Again it is clear that $f$ is continuous and $(0,1]$ is connected so $B$ is connected, and hence $\overline{B}$ is connected. Also, $(0,0)$ is a limit point of $B$ and $B\subset X \subset \overline{B}$. Hence $X$ is connected.
Hope it works.