# Show function with infinitely many discontinuities is Riemann-integrable

Prove that the following function is Riemann-integrable on $[0, 1]$ even though it has infinite many discontinuities on $[0, 1]$: $$f(x) = \begin{cases} 1 & \text{if } x = \frac1n \text{ where } n = 1, 2, 3, \ldots, \\ 0 & \text{otherwise}.\end{cases}$$

I have a possible proof but don't feel too confident about it. If anyone could tell me if its valid or give me another proof, or hints to another proof, that would be very helpful!

Let $\varepsilon > 0$. Observe that given $\frac\varepsilon2$ there exists a least natural number $N$ with $\frac{1}{N+1} < \frac\varepsilon2$. Observe that there are $N$ numbers less than $N + 1$. Now we want to consider the two intervals $[0, \delta]$ and $[\delta, 1]$ with $0 < \delta < 1$ and $\delta = \frac\varepsilon2$.

Lets first consider the interval $[\delta, 1]$. Observe that there are exactly $N$ discontinuities on this interval, that is, $N$ elements of the form $\frac1n$ such that $\frac1N > \frac{1}{N+1}$. This interval is bounded since by construction $f$ is bounded above by 1 and bounded below by 0 and thus it is bounded. We have satisfied the hypothesis of Exercise 6.6 and thus we can conclude that $f$ is Riemann-integrable on $[\delta, 1]$. Moreover, since $f$ is Riemann-integrable on $[\delta, 1]$, by Theorem 6.1, we are assured that there exists a partition $P_2$ such that $U(P_2, f) - L(P_2, f) < \frac\varepsilon2$. Observe that the lower sum is 0 for any given partition, so we have $U(P_2, f) < \frac\varepsilon2$.

Now let us consider the interval $[0, \delta]$. Let $P_1$ be any partition of this set and observe that $$U(P, f) = \sum_{i = 1}^l M_i \, \Delta x_i < 1 \cdot \big( \frac\varepsilon2 - 0\big) = \frac\varepsilon2$$ since the supremum of the entire interval is 1, it must hold that 1 is an upper bound for any smaller interval. Moreover the length of the interval $[0, \delta]$ is $\delta$ which is defined to be $\frac\varepsilon2$. Again it still holds that the lower sum is 0. Thus we have $U(P_1, f) < \frac\varepsilon2$.

Now choose $P = P_1 \cup P_2$ to be a common refinement of $P_1$ and $P_2$ and observe that $$U(P, f) - L(P, f) = U(P, f) = U(P_1, f) + U(P_2, f) = \frac\varepsilon2 + \frac\varepsilon2 = \varepsilon$$

Thus by Theorem 6.1 $f$ is Riemann-integrable on $[0, 1]$.

-
Just to mention something that is good to know: A bounded function $f$ on a closed interval $[a,b]$ is Riemann-integrable on $[a,b]$ if and only if the set of discontinuities of $f$ has measure $0$, and it is possible for an infinite subset of $[a,b]$ to have measure $0$. – Haskell Curry Jan 31 '13 at 9:52
Yes. I know, but the book I'm working through won't get there for another two sections. So I'm stuck using just the definition of Riemann-integrable and mainly a theorem that states that $f$ is Riemann-integrable iff given $\varepsilon > 0$ there exists a partition $P$ such that $U(P, f) - L(P, f) < \varepsilon$. I also proved that if $f$ is bounded and has a finite amount of discontinuities, it is Riemann-integrable on $[a, b]$. – Robert Cardona Jan 31 '13 at 9:59
I think you can simply use the fact that for each $\epsilon>0$, $f$ has only finitely many discontinuities on $(\epsilon,1]$. The interval on which you have to deal with infinitely many discontinuities can be made arbitrarily small and will therefore not matter much in very fine partitions. – Michael Greinecker Jan 31 '13 at 10:07
That's exactly what I tried to show. Did I do it correctly? – Robert Cardona Jan 31 '13 at 18:45

As mentioned in Michael Greinecker's comment, a nice way to go is to use the following result:

Theorem: Let $f: [a,b] \rightarrow \mathbb{R}$ be a bounded function. If for all $c \in (a,b)$ the restriction of $f$ to $[c,b]$ is Riemann integrable, then $f$ is Riemann integrable on $[a,b]$ and $\int_a^b f = \lim_{c \rightarrow a^+} \int_c^b f$.

This result is proved in $\S 8.3.2$ of my honors calculus notes.

-
Thanks! But was my approach correct as well? – Robert Cardona Feb 3 '13 at 7:54