Dirac delta applied to Dirichlet function Let's denote Dirichlet function as $d(x)$:
$$d(x)=\begin{cases}{1,x \in \mathbb{Q}\\ 0,x\not\in \mathbb{Q}}\end{cases}$$
I know that Lebesgue integral of Dirichlet function on any finite domain is zero:
$$\int_a^b d(x) dx=0$$
On the other hand, integral of Dirac function is 1 on any set including $0$ ($a<0<b$):
$$\int_a^b\delta(x)dx=1$$
So, I wonder, what would this integral evaluate to:
$$\int_a^b\delta(d(x))dx$$
? Does $\delta(d(x))$ make sense at all?
 A: The "function" $\delta$ is in reality the measure
$$ \delta(A) = 1 \Leftrightarrow 0 \in A$$
which is not absolutely continuous with respect to the Lebesgue measure. So the expression
$$ \delta(d(x))$$
does not have any sense, since it assumes that "function" $\delta$ is the density of the measure $\delta$ with respect to the Lebesgue measure. 
If we interpret $\delta(x)$ as the "function" which is infinite at 0 an 0 otherwise (while integrating 1) then $\delta(d(x))$ is a "function" which is infinite at any $ x$ rational and 0 otherwise while integrating ... I think the interpretation has reached its limit. 
If there is any mathematical object that could represent $\delta(d(x))$ it is a countable sum of Dirac masses (the generalization of the $\delta(x)$, which is infinite at an arbitrary point $y$, in terms of the 'function' delta that is $\delta_y(x) = \delta(x - y)$) at each rational that is
$$ ``\delta(d(x))  \text{''} = \sum_{y \in \mathbb{Q}} \delta_y $$
and so
$$ ``\int_a^b \delta(d(x)) dx \text{''} =  \sum_{y \in \mathbb{Q}} \delta_y([a,b]) = \sum_{y \in [a,b] \cap \mathbb{Q}} 1  = \infty$$
For $\hat{d}(x) = 1 - d(x)$ is even worse since we would have a non-countable sum of non zero terms an that is not even well-defined in general. 
