Let $\mathbb{R}$ be the D282: Set of real numbers.
Let $\mathbb{Q}$ be the D368: Set of rational numbers.
The Dirichlet function is the D218: Boolean function
\begin{equation}
I_{\mathbb{Q}} : \mathbb{R} \to \{ 0, 1 \}, \quad
I_{\mathbb{Q}}(x) = |\mathbb{Q} \cap \{ x \}|
\end{equation}