Let $$ A \colon= \left\{ (x, y) \in \mathbb{R}^2 \colon \, 0 < x \leq 1, \ y = \sin \frac1x \right\} $$ and $$ B \colon= \left\{ (x, y) \in \mathbb{R}^2 \colon \, y=0, \ -1 \leq x \leq 0 \right\}, $$ and let $$ S \colon= A \cup B. $$
Is this $S$ (when regarded as a subspace of $\mathbb{R}^2$) connected? arcwise connected? If (arcwise) connected, how? If not, why not?
I know that both of $A$ and $B$ are connected as well as arcwise connected, but I'm not sure how to tackle their union. Here $A$ and $B$ are disjoint of course.
Moreover, $A$ is neither open nor closed, whereas $B$ is closed in $\mathbb{R}^2$ but not open.
Note that $C = A \cup \{(0, 0)\}$ is between $A$ and $\overline{A}$, so connected. Now $S = B \cup C$ and $B \cap C \ne \varnothing$, so $S$ is connected.
$S$ is in fact not path-connected. Suppose there is a continuous map $f: [0, 1] \to S$ such that $f(1) = (1, \sin(1))$ and $f(0) = (0, 0)$. Let $t_0 = \sup\{t \in [0,1] \mid f(t) = (0, 0)\}$. Then by continuity, $f(t_0) = (0,0)$. Moreover, setting $f =(f_x, f_y)$ and for $t > t_0$ we must have $f_x(t) > 0$ and therefore $f_y(t) = \sin(1/f_x(t))$. Now for any $\epsilon > 0$ with $t_0 + \epsilon \le 1$, we get $$(0, f_x(t_0 + \epsilon)] \subset f_x((t_0, t_0 + \epsilon])$$ and therefore $$[-1, 1] \subset f_y((t_0, t_0 + \epsilon]).$$ This contradicts the continuity of $f_y$ at $t_0$.
In fact this shows that $A$ and $B$ cannot be in the same path component. Since each is individually path connected, they are exactly the path components of $S$.