# Dirichlet function question

## Homework Statement

Define Dirichlet's function f by putting f(x) = 1 if x is rational and f(x) = 0 if x is irrational. Explain why it is difficult to draw the graph of f. Prove that the lower Riemann sum L(x_0,...,x_n) is always equal to 0 and the upper Riemann sum U(x_0,...x_n) is always equal to 1.

## Homework Equations

Equations for upper and lower Riemann sums.

## The Attempt at a Solution

Hi everyone,
Here's what I've done so far:

The graph is difficult to draw because there are infinitely many rational numbers and infinitely many irrational numbers, all interspersed among one another, so you will continuously be switching between f(x) = 0 and f(x) = 1.

For every rational number, there is an irrational number, so any chosen interval will contain both a rational [f(x) = 1] and irrational [f(x) = 0] number.
m = 0 and M = 1
So the lower Riemann sum will be zero, as two points side-by-side (i.e. a rational and an irrational with only 'vertical' area between them) will have minimum vertical area 0.
And, for the upper Riemann sum, two points side-by-side will have maximum vertical area 1.

Is this correct?

Thanks for any help