Area under a never-continuous function I was thinking about the following function, infamous for being nowhere continuous:
$$f(x\in\mathbb Q)=0$$
$$f(x\notin \mathbb Q)=1$$
How would I calculate the area under this "curve" from $x=0\to1$? Can it be done?
If so, I suspect the result would be very interesting... it would tell us "what proportion of numbers are rational".
But my intuition tells me it cannot be done, because of the lack of a limit anywhere in this function.
Also, something tells me it should be zero, because when using a Riemann Sum, the input of each term will be rational as the interval is divided into rational subintervals.
Any ideas?

The area under this curve is called its Lebesgue integral and is equal to $1$, corresponding to the intuition that most numbers in the interval $[0,1]$ are actually irrationnal.
The Lebesgue integral is an extension of the Riemann integral to a wider class of functions (called "measurable functions"). In your example, $f$ is not Riemann-integrable so there is no hope to compute its integral using Riemann sums.
