If $f: \mathbb{R} \to \mathbb{R}$ is continuous and $f(q)=0 \forall q \in \mathbb{Q}$, prove that $f(x)=0 \forall x \in \mathbb{R}$

75 Views Asked by At

If $f: \mathbb{R} \to \mathbb{R}$ is continuous and $f(q)=0 \forall q \in \mathbb{Q}$, prove that $f(x)=0 \forall x \in \mathbb{R}$

Note: I have to prove this with the help of usual topology on $\mathbb{R}$ and without using the sequential criteria for continuity.

Here's my attempt:

From given definition of f, $f^{-1}(\{0\})=\mathbb{Q}$ at least.

But $\{0\}$ is closed in $\mathbb{R}$ and $\mathbb{Q}$ is not.

Continuous maps take closed sets to closed sets, so $f^{-1}(\{0\})$ must be a superset of $\mathbb{Q}$ which is closed.

The only such set if $\mathbb{R}$, so $f^{-1}(\{0\})=\mathbb{R}$, i.e. $f(x)=0 \forall x \in \mathbb{R}$

Is this correct?

2

There are 2 best solutions below

3
On BEST ANSWER

The following is a well known result that holds for topological spaces $X,Y$:

Consider $2$ functions $f,g:X \to Y$ and $A \subseteq X $where $A$ is dense in $X$ and $Y$ is Haussdorf. If $f$ and $g$ are equal on $A$, then they are equal everywhere.

Now, apply this theorem to $f$ and $g = 0$, and note that the rationals are dense in the reals (and that any metric space is Hausdorff)

2
On

Suppose by contradiction, there is $r\in \mathbb R\backslash \mathbb Q$ s.t. $f(r)\neq 0$. Soppose WLOG that $f(r)>0$. Using continuity, there is a $\delta>0$ s.t. $f(x)>0$ for all $x\in ]r-\delta,r+\delta[$. Since $\mathbb Q$ dense in $\mathbb R$, there is a $q\in\mathbb Q\cap ]x-\delta,x+\delta[$. In particular, $f(q)>0$, contradiction.