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

In order to give an example of a function from $\mathbb{R}$ to itself whose graph is connected in $\mathbb{R} \times \mathbb{R}$, yet is not continuous, the book Berkley Problems on Mathematics refers to a function: $f(x)=\sin(\frac{1}{x})$.

Let $$S_1=\left\{(x,\sin\left(\frac{1}{x}\right))\mid x <0\right\}, \ S_2=\left\{(x,\sin\left(\frac{1}{x}\right)) \mid x >0\right\}.$$ $S_1$ and $S_2$ are both connected subsets of $\mathbb{R} \times \mathbb{R}$. Since $(0,0)$ belongs to the closure in $\mathbb{R} \times \mathbb{R}$ of both $S_1$ and $S_2$, the sets $S_1 \cup \{(0,0)\}$ and $S_2 \cup \{(0,0)\}$ are connected. Since these sets have a point in common, their union $$(S_1 \cup \{(0,0)\}) \cup (S_2 \cup \{(0,0)\})$$ is connected. This union is the graph of the function $f: \mathbb{R} \to \mathbb{R}$ defined by $f(x)=\sin(\frac{1}{x})$, $x \neq 0$, $f(0)=0$, which is not continuous at $x=0$.

In this example, what I don't understand is why $(0,0)$ belongs to the closure of $S_1$ and $S_2$. As I know, the function $f(x)$ vibrates strongly near $0$, so how can the graph get near $(0,0)$? How can $(0,0)$ be in the closure of the two sets?

Many thanks!

-

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$).
Natural $n$? I think $n$ must be an integer for $(1/(n \pi),0)$ to be in $S_2$... –  shinyasakai Apr 20 '11 at 15:36
@shinyasakai: $n$ has to be a natural number; that is, it must be an integer greater than 0. If $n$ is an integer less than zero, then $(1/(n \pi),0)$ is in $S_1$. If $n$ is 0, then $(1/(n \pi),0)$ doesn't make sense at all. –  Chris Eagle Apr 20 '11 at 15:48
Oh, I am wrong... When I read and typed "natural", there was "real" in my mind... But, why will the points tend to $(0,0)$ when $n$ tends to infinity? The invariant of the function $f$ can be any real number, not just numbers of the form $1/n \pi$, where $n$ is natural. –  shinyasakai Apr 20 '11 at 15:48
(In a metric space) A point $p$ is in the closure of a set $S$ if there exists a sequence of points $(p_n)\subset S$ such that $p_n \neq p$ and $|p_n -p| \to 0$ as $n\to \infty$. You seem to be under the impression that the convergence condition needs to hold for all sequences, an impression that is false. –  Willie Wong Apr 20 '11 at 17:01
Alternatively, any neighborhood of (0,0) intersects both $S_1$ and $S_2$, making it a limit point of each of the sets, so that (0,0) must belong to the closure of both. –  gary Apr 20 '11 at 18:28