For a function from $\mathbb{R}$ to itself whose graph is connected in $\mathbb{R} \times \mathbb{R}$, yet is not continuous

Solution 1:

For every natural $n$, $S_2$ contains the point $(1/ (n \pi),0)$. As $n$ tends to infinity, these points tend to $(0,0)$, so $(0,0)$ is in the closure of $S_2$. Similarly, $S_1$ contains $(-1/ (n \pi),0$).