3

Possible Duplicate:
No continuous function that switches $\mathbb{Q}$ and the irrationals

Is there a continuous function $f\colon\mathbb R\to \mathbb R$ such that $f(\mathbb Q)\subseteq \mathbb R-\mathbb Q$ and $f(\mathbb R-\mathbb Q)\subseteq \mathbb Q$?

Aliakbar
  • 3,197

4 Answers4

13

Hint: Consider a continuous function $f:\mathbb R\to\mathbb R$. Either $f$ is constant or $f(\mathbb R)$ is uncountable. (Can you show this? Sub-hint: intermediate value theorem.) If $f(\mathbb R\setminus\mathbb Q)$ is countable, what about the countability/uncountability of the set $f(\mathbb R)$, using the fact that $f(\mathbb R)=f(\mathbb Q)\cup f(\mathbb R\setminus\mathbb Q)$?

Did
  • 284,245
10

HINT: If such an $f$ exists, $$\Bbb R\setminus\Bbb Q=\bigcup_{q\in\Bbb Q}f^{-1}[\{q\}]$$ is the union of countably many closed sets. Now apply the Baire category theorem.

Brian M. Scott
  • 631,399
  • 2
    I just love it when Baire knocks at the door ... – Hagen von Eitzen Jan 01 '13 at 18:17
  • 3
    @Hagen: Lions and tigers and Baires [oh my]. :-) – Brian M. Scott Jan 01 '13 at 18:18
  • Hammer, nails, and all that... – Did Jan 01 '13 at 18:29
  • @BrianM.Scott $\mathbb{R}\setminus \mathbb{Q}$ has empty interior , yet I don't got it how your hint solve the question –  Jan 01 '13 at 19:19
  • @HarryPotter: The Baire category theorem implies that at least one of the sets $f^{-1}[{q}]$ is dense in some interval. If $x$ is a rational in that interval, $f(x)=q$ by continuity, contradicting the hypothesis on $f$. – Brian M. Scott Jan 01 '13 at 19:22
  • @BrianM.Scott sorry for my ignorance, Theorem Baire I know says that countable union of closed empty interior has empty interior or equivalently, countable intersection of open dense set is dense set. what am I missing? –  Jan 01 '13 at 19:30
  • @HarryPotter: Apply the Baire category theorem to $\Bbb R\setminus\Bbb Q$, not to $\Bbb R$. – Brian M. Scott Jan 01 '13 at 19:43
  • @BrianM.Scott How Apply Baire the a non complete topological space? –  Jan 01 '13 at 19:55
  • @kLEIN: The irrationals are completely metrizable, which is all that’s required by the BCT. – Brian M. Scott Jan 01 '13 at 19:57
  • @BrianM.Scott How metric, can you giveme a description? Sorry of my ignorance. –  Jan 01 '13 at 20:02
  • @Eduardo: First find a homeomorphism between the irrationals and $\Bbb N^{\Bbb N}$. This can be done in several ways; continued fraction expansions are one way, and Theorem 1.1 of these notes is another. Then for $\sigma,\tau\in\Bbb N^{\Bbb N}$ define $d(\sigma,\tau)=2^{-n}$, where $n=\min{k\in\Bbb N:\sigma(n)\ne\tau(n)}$. – Brian M. Scott Jan 01 '13 at 20:09
  • @BrianM.Scott Is clearly that this topology generated by this metric is equivalent to canonical topology of the $\mathbb{R}$?? –  Jan 01 '13 at 20:14
  • 1
    I wonder how many of the downvoters understand that the answer is correct, albeit less elementary than was actually necessary. – Brian M. Scott Jan 01 '13 at 20:14
  • @HarryPotter: Of course. This isn’t basic calculus (and I apologize to the OP for not noticing the calculus tag and giving a general topology answer, though it seems to have done no harm), but it is fairly basic topology. – Brian M. Scott Jan 01 '13 at 20:15
  • @BrianM.Scott Thank's for your time. –  Jan 01 '13 at 20:19
1

Suppose by contradiction that such a function exists. Then it is non-constant.

Let $a<b$ be so that $f(a) \neq f(b)$. Then by the IVT $f([a,b])$ is a non-trivial interval. Let call this interval $[c,d]$.

Thus

$$f([ a,b] \cap \mathbb Q)= [c,d] \cap (\mathbb R \backslash \mathbb Q) \,.$$ This implies that $f$ takes a countable set onto an uncountable set, contradiction.

N. S.
  • 134,609
0

See, $f(\mathbb{Q})$ is a countable set, how $f(\mathbb{R-Q})\subset \mathbb{Q}$, then, $f(\mathbb{R-Q})$ is too a countable set, then $f(\mathbb{R})$ is also a countable set. See, a continuous function have a countable image if only if $f$ is a constant function, contradiction!