Continuity of the modified Dirichlet function

continuityreal-analysis

Let
$$
f:(0,1) \to \mathbb{R}, x \mapsto \begin{cases}
\frac{1}{q}, & \text{if } x = \frac{p}{q} \in \mathbb{Q} \text{ with gcd}(p,q) = 1, \\
0, & \text{elsewhere.}
\end{cases}
$$

This function is semicontinuous for $x \in \mathbb{Q}\cap (0,1)$ and continuous for $x \in (\mathbb{R} \setminus \mathbb{Q}) \cap (0,1)$.

Now our professor wrote:

  1. Every rational number is the limit of a sequence of irrational numbers.
  2. Therefore, $f$ is not continuous for $x \in \mathbb{Q} \cap (0,1)$

How does 1. imply 2.? By the same reasoning, couldn't you also say that every irrational number is the limit of a sequence of rational numbers, and therefore, $f$ is not continuous for all $x \in (\mathbb{R} \setminus \mathbb{Q}) \cap (0,1)$.

He continues:

  1. On the other hand, for every $q \in \mathbb{N}$ there exist maximum $q$ rational numbers of the form $\tfrac{p}{q}$ in $(0,1)$.
  2. Therefore, for each sequence $(\tfrac{p_n}{q_n})_{n \in \mathbb{N}}$, which converges to an irrational number $x$, we have $\lim_{n \to \infty} \frac{1}{q_n} = 0$ and so $f$ is continuous in $x$

Here, I understand 2., but what does 1. have to do with it?

Best Answer

Now our professor wrote:

1. Every rational number is the limit of a sequence of irrational numbers.

2. Therefore, $f$ is not continuous for $x\in\mathbb Q\cap(0,1)$.

How does 1. imply 2.?

Take some rational number $r\in\mathbb Q\cap (0,1)$. There exists a representation $r=\frac{p}{q}$ such that $gcd(p,q)=1$. So, there holds $f(r)=\frac1{q}>0$. Now, you can use 1. to get a sequence $(x_n)_n$ in $(\mathbb R\setminus \mathbb Q)\cap (0,1)$ such that $x_n\to r$. But $x_n$ are all irrational, hence $f(x_n)=0$ for all $n$!. You get $$ f(x_n)=0\to 0$$ But $f(r)\neq 0$. You have got a contradition to the continuity at $r$.

By the same reasoning, couldn't you also say that every irrational number is the limit of a sequence of rational numbers,

Yes you can.

and therefore, f is not continuous for all $x\in(\mathbb R\setminus \mathbb Q)\cap (0,1)$.

No, here you have to be careful since the situation changed! If you approximate the irrational number by a sequence of rational numbers, you have to to a bit more work to see what the values of the sequence are.

Let us pick an irrational number $x\in(\mathbb R\setminus \mathbb Q)\cap (0,1)$. Then you now, that $f(x)=0$. If you like to get a contradiction using a sequence $(r_n)_n$ of rational numbers in $(0,1)$, then you have to find a sequence such that $f(r_n)\not\to 0$. But in that case, there exists $\varepsilon>0$ such that your sequence has infinitely many elements such that $f(r_n)>\varepsilon$. Therefore, we can choose a subsequence $(r_{n_k})_k$ such that $f(r_{n_k})>\varepsilon$ for all $k$. Next, we choose a $q\in\mathbb N$, such that $\varepsilon>\frac1q$. But $f(r_{n_k})>\frac1q$ will lead to the contradition $r_{n_k}\not\to x$.

He continues: [...]

If you just have a sequence $\left(\frac{p_n}{q_n}\right)_n$, why should you get $\frac1{q_n}\to 0$? It is because of 1. If $\frac1{q_n}\not\to 0$, then $q_n$ is bounded from above. But then $\left(\frac{p_n}{q_n}\right)_n$ has, because of 1., just finitely many different elements and $\frac{p_n}{q_n}\to x$ can't hold, since the distance from $x$ to finitely many rational points is positive.

Related Question