Does there exist a continuous function $f:\mathbb{R}\to\mathbb{R}$ such that $$x\in\mathbb{R}\setminus\mathbb{Q}\implies f(x)\in\mathbb{Q}$$ and $$x\in\mathbb{Q}\implies f(x)\in\mathbb{R}\setminus\mathbb{Q}\;\;\;?$$
Asked
Active
Viewed 130 times
1
-
2What can you say about a continuous function on a dense subset? That kind of though is what you should try on your own, this question as stated shows no thought process. – Anthony Jan 21 '22 at 23:59
-
1The range is countable so $f$ is a constant. This question has been answered before on this site. – Kavi Rama Murthy Jan 22 '22 at 00:01
-
@KaviRamaMurthy I think the OP means that rationals are mapped to irrationals and vice versa. I do not quite see why the range would be countable. Probably I am just too tired. – Severin Schraven Jan 22 '22 at 00:06
-
1@SeverinSchraven Rationals can only map to a countable set. Irrationals map to rationals. – Kavi Rama Murthy Jan 22 '22 at 00:07
-
2@KaviRamaMurthy Thank you. Indeed, I should stop working for today. Have a nice weekend. – Severin Schraven Jan 22 '22 at 00:09
-
https://math.stackexchange.com/q/55638/42969 – Martin R Jan 22 '22 at 00:50
-
https://math.stackexchange.com/q/576708/42969 – Martin R Jan 22 '22 at 05:01
1 Answers
9
The function $g(x):= xf(x)$ assumes only irrational values, or $0$. If $g(x)$ assumes more than one value, by the intermediate value theorem it assumes all values on an interval (since $g$ is continuous as the product of two continuous functions). This interval necessarily contains a nonzero rational number, a contradiction. So $g(x)\equiv c$ must be constant.
If $c=0$, then $f(x)=0$ on the nonzero rationals, a contradiction. If $c\neq 0$, then $f(x)=c/x$, which is not defined (and thus not continuous) at $x=0$, a contradiction.
So no such $f$ exists.
Rod Laver
- 260
-
1
-
2Yeah this proof is incomplete, as a caveat needs to be introduced both for $f(x)=0$ as @MartinR mentions as well as for $x=0$. – Dustan Levenstein Jan 22 '22 at 00:47
-
Yeah OK, thanks for pointing that out. It's fixed. I didn't need a caveat for both, just to consider $g=0$. – Rod Laver Jan 22 '22 at 00:57
-
2
-
-
@MartinR OK, I didn't see that. What do you propose should be done? I thought if this question were a duplicate, a moderator would have taken it down long before I wrote an answer... It's inconvenient for new users to lose upvotes post facto. – Rod Laver Jan 22 '22 at 05:20
-
1@RodLaver: Here are my personal thoughts. First, and most important: The question does not match the standards of this site and so should not be answered in the first place. Instead, encourage new users to improve their posts. As you can see, the question has been closed for that reason. – Martin R Jan 22 '22 at 08:38
-
(Cont.) I don't know what you mean by “taken down long before I answer” – you answered the question shortly after it was posted. Anyway, searching for duplicates is expected from all users and not a special task for moderators. In this case it took me a while to find an exact duplicate, so one cannot blame you on that. – Martin R Jan 22 '22 at 08:38
-
(Cont.) Whether you delete your answer or not is up to you. I would do it because the identical answer has been posted before. But of course I am in a different position (rep wise :-) – Martin R Jan 22 '22 at 08:38
-
As I recall, the problem had around 20 views when I answered it, and other moderators had already commented above. That's why I assumed it would've been taken down long before I posted my answer, but I wasn't aware the question had just been posted. – Rod Laver Jan 22 '22 at 08:55
-
(Cont.) I was aware of the T&C around question format, but again, the fact that the moderators were discussing it and it had no downvotes made me think it was OK to post an answer. I'm happy to comment rather than answer next time though, if this is preferred. – Rod Laver Jan 22 '22 at 08:56
-
(Cont.) I'll also do a preliminary search for duplicates before I answer next time, but spending too much time on that does in my opinion detract from the appeal of the site to new users, and should (I think) fall more to the moderators. – Rod Laver Jan 22 '22 at 08:56
-
(Cont.) I'm going to leave my answer up because I think it's phrased a bit more concisely than the one you pointed out to me, and also (as you alluded to), gaining reputation at this level is tedious (I've tried to flag to moderators where I was a victim of upvote syphoning by more experienced contributors duplicating my solutions on the same post). – Rod Laver Jan 22 '22 at 08:56