Define $\displaystyle f: [0,1] \to [0,1] $ by $\displaystyle f(x) = \begin{cases} 0 \ \ \ \ \text{if} \ x \ \ \text{is irrational} \\ \frac{1}{q} \ \ \ \ \text{if} \ x \ \text{is rational} \ \text{and} \ x = \frac{p}{q} \ \text{in lowest terms} \end{cases} $

(a) Show that $\displaystyle f $ is discontinuous at every rational number.

So there exists a sequence $\displaystyle (x_n) $ converging to $\displaystyle a \in [0,1] $, $\displaystyle a \in \mathbb{Q} $ such that $\displaystyle (f(x_n)) $ does not converge to $\displaystyle f(a) $. So maybe come up with a sequence that has both irrational and irrational terms? Thus it would oscillate? For example, we can approximate $\displaystyle \frac{1}{2} $ by a sequence with both rational and irrational terms?

(b) Fix $\displaystyle t \in \mathbb{R} $ and $\displaystyle n \in \mathbb{N} $. Show that $\displaystyle f $ maps only finitely many elements of $\displaystyle (t-\frac{1}{2}, t+ \frac{1}{2}) $ to $\displaystyle \frac{1}{n} $.

Suppose $\displaystyle t = 1 $ and $\displaystyle n =2 $. In other words, we want to show that $\displaystyle f $ maps only finitely many terms from $\displaystyle \left(\frac{1}{2}, \frac{3}{2} \right) $ to $\displaystyle \frac{1}{2} $. So given a sequence $\displaystyle (x_n) $ that approximates $\displaystyle \frac{1}{2} $, it will have a finite number of rational terms from part (a). Is this correct?

(c) Show that $\displaystyle f $ is continuous at every irrational number.

Given any sequence $\displaystyle (x_n) $ in $\displaystyle [0,1] $ converging to $\displaystyle a \in [0,1] $, $\displaystyle a \in \mathbb{R} \ \backslash \mathbb{Q}$, $\displaystyle (f(x_n)) $ converges to $\displaystyle f(a) $. So we can always find an "irrational" sequence that approximates $\displaystyle a $? Thus $\displaystyle (f(x_n)) $ converges to $\displaystyle 0 $?

(d) Let $\displaystyle \epsilon >0 $. Prove that $\displaystyle f $ maps only finitely many elements of $\displaystyle [0,1] $ to a value greater than $\displaystyle \epsilon $.

This is the same as part(b) right?

(e) Prove that $\displaystyle f $ is Riemann integrable on $\displaystyle [0,1] $ and that $\displaystyle \int_{0}^{1} f = 0 $.

Here we just consider $\displaystyle |\mathcal{R}(f,P)| $? And bound it and show it is less than $\displaystyle \epsilon $?