[Math] $f(x) = 0$ if x is irrational, $f(x) = 1$ if x is rational. Does a limit exist

real-analysis

Does the following function have a limit as x approaches a?

$f(x) = 0$ if x is irrational, $f(x) = 1$ if x is rational.

Answers given in terms of delta-epsilon please!

My thoughts so far:

(1.) Its graph seems to show this function acting as though it were two constant functions

(2.) Between any two rational numbers there are infinitely many rational numbers; between any two rational numbers there are infinitely many irrational numbers. So I cannot think of any interval where rational numbers wouldn't interrupt irrational numbers, or irrational numbers interrupt rational numbers.

I'm sorry to have so little to add to the question. This is just one of those functions which goes beyond anything you've learned.

Best Answer

You are correct that there is no limit: in particular, you can find sequences $(x_n)$ and $(y_n)$ converging to $a$ such that all $x_n$ are rational and all $y_n$ are irrational (this follows from your density argument: simply pick some rational $x_0$ and irrational $y_0$, and construct your sequences by repeatedly choosing a rational/irrational from the interval centred on $a$ of length $|a - x_0|$ / $|a - y_0|$ (not including $a$): the sequences thus produced have the required properties.

Thus, for every potential limit $c$, choose $\varepsilon = \frac{1}{2}$. Then for any $\delta > 0$, there is some $n$ such that $x_n$ and $y_n$ lie in $(a-\delta,a+\delta)\setminus \{a\}$. Finally, note that either $|f(x_n) - c| = |1 - c| \geq \varepsilon$ or $|f(y_n) - c| = |c| \geq \varepsilon$ (since if $|c| < \frac{1}{2}$, then $c < \frac{1}{2}$, so $|1 - c| = 1 - c \geq \frac{1}{2}$). Thus, $\lim\limits_{x\to c}f(x)$ does not exist.

Related Question