In mathematics, the Dirichlet function is the indicator function 1ℚ of the set of rational numbers ℚ, i.e. 1ℚ(x) = 1 if x is a rational number and 1ℚ(x) = 0 if x is not a rational number (i.e. an irrational number).
- The Dirichlet function is nowhere continuous.
- Its restrictions to the set of rational numbers and to the set of irrational numbers are constants and therefore continuous. The Dirichlet function is an archetypal example of the Blumberg theorem.
- The Dirichlet function can be constructed as the double pointwise limit of a sequence of continuous functions, as follows:
For any real number x and any positive rational number T, 1ℚ(x + T) = 1ℚ(x). The Dirichlet function is therefore an example of a real periodic function which is not constant but whose set of periods, the set of rational numbers, is a dense subset of ℝ.
- The Dirichlet function is not Riemann-integrable on any segment of ℝ whereas it is bounded because the set of its discontinuity points is not negligible (for the Lebesgue measure).
- The Dirichlet function provides a counterexample showing that the monotone convergence theorem is not true in the context of the Riemann integral.
- The Dirichlet function is Lebesgue-integrable on ℝ and its integral over ℝ is zero because it is zero except on the set of rational numbers which is negligible (for the Lebesgue measure).
- "Dirichlet-function", Encyclopedia of Mathematics, EMS Press, 2001 
- Dirichlet Function — from MathWorld
- Lejeune Dirichlet, Peter Gustav (1829). "Sur la convergence des séries trigonométriques qui servent à représenter une fonction arbitraire entre des limites données". Journal für die reine und angewandte Mathematik. 4: 157–169.
- Dunham, William (2005). The Calculus Gallery. Princeton University Press. p. 197. ISBN 0-691-09565-5.