In mathematics, the Dirichlet function[1][2] is the indicator function of the set of rational numbers , i.e. if x is a rational number and if x is not a rational number (i.e. is an irrational number).
It is named after the mathematician Peter Gustav Lejeune Dirichlet.[3] It is an example of a pathological function which provides counterexamples to many situations.