Integral of $1$ minus Dirichlet's function Suppose $f:[0,1] \to \mathbb R$ is defined as 
$$
f(x) = 
\begin{cases} 
1, &\text{if } x \text{ is irrational; and } \\
0,  &\text{if }x \text{ is rational}.
\end{cases}
$$
I know from Real Analysis that $\int_0^1 f =1$, but intuitively it seems that the "area under curve" is 0.   
Is there some intuitive explanation as to why $\int_0^1 f =1$  (without using measure theory)?
 A: Some of this answer is implicit in many people's comments, but let's make it explicit.
Here's a question. It seems to you that the area under the curve --- of Dirichelt's function --- is zero. But Dirichelt's function is not a "curve", precisely because it is discontinuous. What then do you mean?
Let's consider that idea of "under the curve", for some possible failures of intuition.
If you take the phrase "under the curve" very seriously, you'll probably be thinking of something like the lower Darboux sum. This, indeed, is zero for any interval, because there is no space for any rectangles of finite width underneath "the curve". The problem is that the Darboux integral is not well-defined, because the upper Darboux sum for any interval is the length of the interval --- because the shortest rectangles of finite width which envelop the function are the rectangles of height 1.
Thus, Dirichlet's function is not integrable by techniques such as the Darboux integral, because the upper and lower Darboux sums do not coincide. Additional techniques are required --- such as measure theory --- to define the integral at all.
A: The rationals are a set of Lebesgue measure zero, so they don't impact the value of integrals.
Here's how you might see that.  Start with an epsilon > 0.  You can count the rationals, so put an interval of length epsilon/2 over the first rational.  Put an interval of length epsilon/4 over the second rational, etc.  You've created a sequence of intervals of total length epsilon that cover the rationals, so they must have measure less than epsilon.  But epsilon was arbitrary, so they must have measure zero.
