for the function $f:\Bbb R\to\Bbb R$ (standard topologies) defined by
$f(x)= x$ if $x$ is a rational number
$f(x)= -x$ if $x$ is not rational
Prove that $f$ is continuous at the point $x=0$, but not for any other point.
for the function $f:\Bbb R\to\Bbb R$ (standard topologies) defined by
$f(x)= x$ if $x$ is a rational number
$f(x)= -x$ if $x$ is not rational
Prove that $f$ is continuous at the point $x=0$, but not for any other point.
I hope the following proof is correct :
Clearly $f(0)=0$ and for all real $x$, $|f(x)|\leq |x|$.
Let $\epsilon >0$ and $\eta=\epsilon$
Thus $\eta>0$ and then for all real $x$,
$|x|\leq \eta $ implies $|f(x)|\leq |x|<\eta=\epsilon$
Therefore, $f$ is continuous at $0$.
Now, let $a$ a real number $\neq 0$. We argue in the case where $a$ is irrational (respectively irrational).
Let $\epsilon_0=|a|$; this is a strictly positive real and $\eta >0$.
We choose a irrational (respectively rational ) $x$ such that $a<x<a+\eta$ if $a>0$ and $a-\eta<x<a$ if $a<0$.
Therefore $|x|>|a|$, so $$ |f(x)-f(a)|=|0-a|=|a| $$ (respectively: $$ |f(x)-f(a)|=|x-0|=|x|>|a| $$ Thus, $$ |f(x)-f(a)| \geq\epsilon_0 $$
$f$ is discontinuous at $a$. $\square$
The statement appears false. Consider the open interval $U = (\frac{-1}{4} + \epsilon, \frac{1}{2} + \epsilon)$ for $\epsilon < 1/4$. The inverse image is $(\mathbb{Q} \cap U) \cup \left( (\mathbb{R}-\mathbb{Q}) \cap U \right)$. The first part of the union includes the rationals in $[0,1/2]$. The second part contains no irrationals in $[1/4,1/2]$. This leaves all rationals in $(1/4,1/2]$ without their irrational friends. Under the usual topology this set of rationals is neither open nor closed. (Its interior is empty, so its not open. Its closure is the interval $[1/4,1/2]$ so it's not closed (not even close). Therefore, this set of rationals is neither open nor closed.) Thus we have found a neighborhood of zero that is not mapped from an open set. This function is not continuous at zero. (It isn't continuous anywhere else, for pretty much the same reason. Continuity isn't preserved when you map a dense subset somewhere else.)