Recall that this function looks to our imperfect eyes like two lines,
but in fact those lines consist of infinitely many dots with infinitely many gaps between them. For details see Functions - Theory - Elementary functions - Dirichlet function.
We claim that this strange function is not integrable on any closed
interval. Consider numbers
Indeed, pick any partition P of [a,b]. Now consider one
of the segments
Since rational numbers are dense, there must be a rational number inside
Similarly, since irrational numbers are dense, there must be an irrational
number inside
Consequently,
This is true for any partition P, therefore
and the function is not Riemann integrable on