Maths WorkshopMaths problems with full solutions
Exercise 1467Calculus › Single-variable calculus › LimitsL1Added 1 Nov 2026

The Dirichlet function has no limit anywhere

#sequences#density#non-existence of limits#pathological functions

Statement

The Dirichlet function is D:R→RD:\mathbb{R}\to\mathbb{R}, with D(x)=1D(x)=1 if xx is rational and D(x)=0D(x)=0 if xx is irrational. Prove that for every real number aa, DD has no limit at aa.

Hint

Between any two distinct real numbers there is a rational number and an irrational number. Use this to build two sequences converging to aa.

Show solutionHide solution

Solution

Idea. Near any point, the function keeps jumping between 00 and 11 in an extremely dense way. Two sequences, one made of rationals and one of irrationals, will reveal it.

Two sequences. Fix a∈Ra\in\mathbb{R}. For every n≥1n\ge1, the interval (a,a+1n)\left(a,a+\frac1n\right) contains a rational number rnr_n and an irrational number sns_n. Then rn→ar_n\to a and sn→as_n\to a.

Values. D(rn)=1D(r_n)=1 for all nn, so D(rn)→1D(r_n)\to1. And D(sn)=0D(s_n)=0 for all nn, so D(sn)→0D(s_n)\to0.

Conclusion. If DD had a limit ℓ\ell at aa, both 11 and 00 would equal ℓ\ell. This is impossible, so DD has no limit at any point aa.

Remark. In particular DD is not continuous anywhere. The problem "xx times the Dirichlet function" shows how multiplying by xx changes this.