## Examples 7.1.17(b):

Let

We have seen this function before, where we have shown that
it is continuous at all irrational numbers and discontinuous
at the rationals. In particular, the function has countably
many points of discontinuity. Since the discontinuities are dense, i.e.
they are "all over" the interval where

*p, q*relatively prime and*q > 0*, and assume*g*is restricted to*[0, 1]*. Is*g*Riemann integrable ? If so, what is the value of the integral ?*[0, 1]*it might seem that it is difficult to find the value of the integral (if the function

*is*Riemann integrable). But with the theoretical background we developed so far it will be easy to compute the answer.

Having countably many discontinuities, we know by our previous theorem that the function is Riemann integrable and it remains to find the value of the integral.

Take any partition *P = {x _{0}, x_{1}, ..., x_{n}}*
and look at:

Since every subintervald_{j}= inf{g(x): x [x_{j-1}, x_{j}]}

*[x*contains irrational numbers we clearly have that

_{j-1}, x_{j}]*d*for all

_{j}= 0*j*. But then the lower integral

*I*must also be 0.

_{*}(g) = sup{ L(g,P): P a partition of [a, b]}
Since *g* was integrable the upper and lower integral agree
so that

forg(x) dx = 0

*a = 0*and

*b = 1*.