The problem is to prove that,

If $f:\mathbb{R}\to\mathbb{R}$ defined by $$ \begin{align} f(x) = \begin{cases} 0 & \text{if $x\in \mathbb{R}\setminus\mathbb{Q}$}\\ \dfrac{1}{n} & \text{if $x = \dfrac{m}{n}$ where $\gcd(m,n) = 1$} \end{cases} \end{align} $$ then show that the function is continuous at irrational points.

My Argument

Take any sequence $(x_n)_{n\ge1}$ converging to an irrational number $x$. Let $S$ be the set of all the denominators of the rational $x_n$'s. Now if $S= \emptyset$ the proof is trivial.

So, let $S\ne\emptyset$. We need to show that $S$ is an infinite subset of $\mathbb{N}$.

Suppose on the contrary that, $S$ is finite, i.e., there is a finite number of members in $S$. Let them be $q_1,q_2,\ldots,q_k$. Now we claim that,


If the sequence consists of infinitely many rational numbers and if $(x_{n_k})_{k\ge1}$ be the subsequence of $(x_n)_{n\ge1}$ composed only of the rational members of $(x_n)_{n\ge1}$ then for all sufficiently large $k\in \mathbb{Z}^+$ there will exist at least one $x_{n_k}$ for which its denominator $q$ satisfies, $$q>\max(q_1,q_2,\ldots,q_n)$$


Suppose the claim is not true. Let us define, $$U=\left\{\dfrac{p_i}{q_i}:q_i\in S\right\}$$The important thing to notice is that $U$ is a finite set.

Now let us further partition $U$ into $U^+$, $U^0$ and $U^{-}$ defined by,

$$U^{+}=\left\{\dfrac{p_i}{q_i}:q_i\in S\land \dfrac{p_i}{q_i}>x\right\}\\U^{-}=\left\{\dfrac{p_i}{q_i}:q_i\in S\land \dfrac{p_i}{q_i}<x\right\}$$

Now (if possible) consider $\min U^{+}$ and $\max U^{-}$ and define $$\varepsilon< \left\lvert x-\min (\min U^+,\max U^-)\right\rvert$$Then in the interval $(x-\varepsilon,x+\varepsilon)$ no member of $U$ can exist because otherwise it will contradict our choice of $\min U^+$ or $\max U^-$. But in the interval there must exist members of the sequence $(x_{n_k})_{k\ge1}$ for all sufficiently large $k$.

Since the denominators cannot be from the set $S$, there must exist a $q\in \mathbb{N}$ which also belongs to $S$. Thus our proof is complete.

The proof of the continuity at irrational points follows immediately from the above claim.

Can anyone tell me whether the proof is correct or not?

  • $\begingroup$ It's very long and sound for me. You can prove it much more shorter and simpler. $\endgroup$ Commented Jul 20, 2015 at 16:08
  • $\begingroup$ I strongly believe that the limit is a topological notion that means that we can not talk about continuity or even limit in such points if not it exists a neighborhood of every irrational nmber such that the function has a limit zero when each point of this neighborhood is convegent to the irrational number which contains obviously rational numbers also. $\endgroup$ Commented Jul 20, 2015 at 16:13
  • $\begingroup$ @MichaelGaluza: Sure. I know that I can prove it in a much simpler way. However, I am concerned with the above argument because our professor said it seems to him that the argument has some subtle error. But I couldn't find it. That's why I posted this proof. If it is correct, can you tell me how the writing can be improved (if it is necessary at all) ? $\endgroup$
    – user170039
    Commented Jul 20, 2015 at 16:50

1 Answer 1


Let $\epsilon>0$ and let $n\in\mathbb{N}$ such that $n>\frac{1}{\epsilon}$.

For $i\in\mathbb{N}$, define $\delta_i=\min_m\left|x-\frac{m}{i}\right|$. The absolute value is always nonzero because $x$ is irrational and since $x$ lies between two fractions with denominator $i$, this is really just a minimum over two $m$-values, and, therefore, is positive.

$\delta=\min_{i=1,\cdots,n}\delta_i$. Then $\delta>0$.

Let $|y-x|<\delta$. If $y$ is irrational, $|f(x)-f(y)|=0$. If $y$ is rational, then the denominator of $y$ is at least $n$, so $|f(x)-f(y)|\leq\frac{1}{n}<\epsilon$.

  • 2
    $\begingroup$ The question asked for proof verification, not an alternative proof. $\endgroup$
    – user170039
    Commented Jul 20, 2015 at 17:03

You must log in to answer this question.