# Does this uncountable set of $\mathbb{R}\times\mathbb{R}$ contain a dense set?

I tried to find a different solution of the following problem: If $f$ is a function from $\mathbb{R}$ to $\mathbb{R}$, such that $f$ attains every value exactly twice, $f$ cannot be continuous.

My attempt: $f:\mathbb{R} \to \mathbb{R}$, let $g:\mathbb{R}\times\mathbb{R} \to \mathbb{R}$, $g(x,y)=f(x)-f(y)$. Let $f$ is continuous, then so is $g$. As $f$ attains every value exactly twice $f$ can't be constant, and as $f$ is continuous, $f$ is uncountable. Thus there are uncountably many pairs of points $(x,y)$ such that $f(x)=f(y)$. Thus $g$ sends uncountably many points of $\mathbb{R}\times\mathbb{R}$ to $0$. Now if every uncountable set of $\mathbb{R}$ contains a dense set, then $g$ sends a dense set to $\{0\}$. Thus $g$ is $0$. But then $f$ is constant, contradiction. Thus $f$ isn't continuous.

So the real problem: Is it true that this uncountable set contains a set, dense in $\mathbb{R}\times\mathbb{R}$?

• No, the interior of each disc is uncountable but not dense. – Angina Seng Nov 2 '17 at 18:34
• Dense in what? ${}{}$ – MPW Nov 2 '17 at 18:37
• @LordSharktheUnknown perhaps somewhere dense was intended. In particular, for every uncountable set $A$, does there exist some open neighborhood $U$ so that $A \cap U$ is dense in $U$ – Andres Mejia Nov 2 '17 at 18:38
• @AndresMejia Is that the case for the Cantor set inside $\Bbb R$? – Angina Seng Nov 2 '17 at 18:39
• Why not use the intermediate value theorem somehow? – fleablood Nov 2 '17 at 22:51

I would appeal to the major theorems about continuous functions on closed and bounded intervals. For instance, there must be points $a$ and $b$ with $a < b$ and $f(a) = f(b) = 0$. Let $M$ and $m$ be the maximum and minimum values of $f$ on $[a,b]$. Either $M > 0$ or $m < 0$ (otherwise $f$ is constant, which would be a contradiction); assume without loss of generality that $M > 0$.

There exists $c$ in $(a,b)$ such that $f(c) = M$. Then there exist $d$ and $e$ such that $a < d < c < e < b$ and $f(d) = f(e) = M/2$.

There must be a second point $p$ with $f(p) = M$. Cases:

1. If $p < a$, then there is a third point $q$ with $p < q < a$ and $f(q) = M/2$.
2. If $p > b$, then there is a third point $q$ with $b < q < p$ and $f(q) = M/2$.
3. If $a < p < b$ then $f$ is constant on the interval between $c$ and $p$, $f$ has a minimum $m'$ between $c$ and $p$. Assume $p < c$; then we can find four points $r_1$, $r_2$, $r_3$, and $r_4$ such that $a < r_1 < p < r_2 < r_3 < c < r_4$ and $f(r_i) = (M+m')/2$.

These all contradict the assumption that each value has exactly two points in its preimage. OK, that's ugly; but perhaps you can simplify it.

• This doesn't answer the question that was asked, which was about density of uncountable sets. – user357151 Nov 2 '17 at 22:45
• @Desire. That's true. I first read the question as "I am trying to solve this problem. Here is my solution. Here is where I am stuck." I thought maybe an alternate solution would be welcome, that doesn't dead-end in this technicality. Now I see the OP wrote that they sought a different solution; though it's not clear as to different from what. – Matthew Leingang Nov 2 '17 at 23:07
• If $p<a$ the interval $(0,M)$ is a subset of $f(\;(p,a)\;)$ and a subset of $f(\;(a ,c)\;)$ and a subset of $f(\;(c,b)\;)$. – DanielWainfleet Nov 3 '17 at 1:53

$\mathbb{R}\times \{0\}$ is an uncountable subset of the plane that contains no dense subset (countable or not) of the plane. There are a lot more examples of course.

• I know that, but R×{0} cannot be the inverse of {0} here, I have edited my question. Please have a look. – user398623 Nov 3 '17 at 3:41

Let $f$ be a continuous function that achieves each value exactly twice.

Let $x < y$ so that $f(x) = f(y) = a$. Let $w < v$ be so that $f(w) = f(v) = b > a$. As a directly result of Intermediate value theorem either $x < w < v < y$ or $w < x < y < v$.

So let $A = \{x|$ if $f(x) = f(w)$ and $w \ne x$ then $x< w\}$ and $B = \{x|$ if $f(x) = f(w)$ and $w \ne x$ then $x> w\}$.

This basically a "cut". All reals are either in $A$ or $B$. Every element of $A$ is less than every element of $B$.

So let $s= \sup A = \inf B$ and $(-\infty, s) \subset A$ and $(s, \infty) \subset B$.

So the question is, is $s \in A$ or is $s \in B$? Either option leads to a contradiction.

• I don't want a solution of that problem, I already know that. My question is different. I have edited my question. Please have a look. – user398623 Nov 3 '17 at 3:42

If any uncountable subset of $\mathbb R^2$ contained a dense set, then—since supersets of dense sets are dense—this would mean that

any uncountable subset of $\mathbb R^2$ is dense.

This is clearly absurd.

In addition, it is easy to construct continuous, non-constant functions $g:\mathbb R^2\to\mathbb R$ such that $g^{-1}(\{0\})$ is uncountable yet not dense, so your particular argument does not reveal any contradiction.

Using the assumptions you made to obtain a contradiction, I will show that the set $g^{-1}(\{0\})$ cannot be dense in $\mathbb R^2$ (and hence nor can it contain any dense subset).

To see this, pick any $(x,y)\in\mathbb R^2$ such that $f(x)\neq f(y)$. This is certainly possible because $f$ is obviously not constant. Without loss of generality, suppose that $f(x)<f(y)$ and let $$\alpha\equiv\frac{f(x)+f(y)}{2}.$$ Since $f$ is continuous, there exist $\varepsilon_x>0$ and $\varepsilon_y>0$ such that

• $f(z)<\alpha$ whenever $x-\varepsilon_x<z<x+\varepsilon_x$; and
• $f(z)>\alpha$ whenever $y-\varepsilon_y<z<y+\varepsilon_y$.

Let $\varepsilon\equiv\min\{\varepsilon_x,\varepsilon_y\}$. Now, if $(z_1,z_2)\in\mathbb R^2$ is within a circle of radius $\varepsilon$ centered around $(x,y)$, then $|z_1-x|<\varepsilon_x$ and $|z_2-y|<\varepsilon_y$, so that $$g(z_1,z_2)=f(z_1)-f(z_2)<\alpha-\alpha=0,$$ so that $(z_1,z_2)\notin g^{-1}(\{0\})$.

The conclusion is that the circle of radius $\varepsilon$ around $(x,y)$ does not contain any points from $g^{-1}(\{0\})$. This means that $g^{-1}(\{0\})$ is not dense.

• I didn't say 'any set'. The g-inverse set of {0} is uncountable, I am asking if this uncountable set contains any dense set. If a,b belongs to this set, where a, b are different, the components of a and b are different. So R×{0} cannot be this set. – user398623 Nov 3 '17 at 5:05
• @user398623 I see. So are you basically asking whether the following is true? \begin{align*} \phantom{5} \end{align*} For any $x,y\in\mathbb R$ and any $\varepsilon>0$, there exist some $x^*,y^*\in\mathbb R$ such that \begin{align*} |x^*-x|<&\;\varepsilon,\\|y^*-y|<&\;\varepsilon,\quad\qquad\text{and }\\f(x^*)=&\;f(y^*). \end{align*} – triple_sec Nov 3 '17 at 5:19
• @user398623 I just amended my answer, for your interest. – triple_sec Nov 3 '17 at 21:32