# How to show that $F$ is integrable with countable discontinuities?

I'm having some trouble to show that a certain function is Riemann integrable with a countable set of discontinuities. The function is built as follows: pick $\{a_n\}$ a countable dense sequence on the interval $[0,1]$. Let $f: \mathbb{R}\to \mathbb{R}$ be defined as: $f(x) = 0$ if $x < 0$ and $f(x) = 1$ if $x\geq 0$. We define $F: [0,1]\to \mathbb{R}$ by

$$F(x)=\sum_{n=1}^{\infty}\dfrac{f(x-a_n)}{n^2}.$$

I want to show that $F$ is integrable and has discontinuities at all points of the sequence $\{a_n\}$.

First we have to show that $F$ is well defined. This is quite simple, we let $g_n : [0,1]\to \mathbb{R}$ be defined as $g_n(x) = f(x-a_n)/n^2$ and then we notice that since $|f(x)|\leq 1$ for all $x\in \mathbb{R}$ we have

$$0 \leq |g_n(x)| \leq \dfrac{1}{n^2}, \quad \ \forall n\in \mathbb{N},x \in [0,1].$$

In that case, since $F = \sum_{n=1}^\infty g_n$, the Weirstrass M-test guarantees that $F_n = \sum_{k=1}^n g_k$ converges uniformly to $F$. So the series defining $F$ converges and furthermore, converges uniformly. This is fine.

But now showing that $F$ is integrable with discontinuities at all points of $\{a_n\}$ seems a little complicated. I had no idea whatsoever untill now on how to do this.

How can I show that $F$ is integrable and discontinuous at all points of $\{a_n\}$?

$F$ is Riemann integrable
We denote for $p \in \mathbb N$ the step function: $$F_p(x)=\sum_{n=1}^p\dfrac{f(x-a_n)}{n^2}$$ Also by making an integral-series comparison, for all $p \ge 2$: $$\frac{1}{p} \le \sum_{n=p}^\infty\dfrac{1}{n^2} \le \frac{1}{p-1}$$ Therefore for all $p \ge 2$ and $x \in[0,1]$ $$F_p(x) \le F(x) \le F_p(x) + \frac{1}{p-1}$$ The LHS and RHS are step functions and the integral over $[0,1]$ of their difference which is equal to $\frac{1}{p-1}$ converges to $0$ as $p \to \infty$. This proves that $F$ is Riemann integrable.
$F$ is discontinuous at all $a_n$
Let $A_x= \{n \in \mathbb N \ ; \; a_n < x\}$ and suppose that $x=a_N$. You have $$\begin{cases} F(t) &< \sum_{n \in A_x} \frac{1}{n^2} &\text{ for } t<x\\ F(t) &\ge \sum_{n \in A_x} \frac{1}{n^2} + \frac{1}{N^2} &\text{ for } t \ge x \end{cases}$$ proving that $F$ is discontinuous at $x$.