Let's assume that $f:[a,b]\to\mathbb{R}$ is bounded, i.e. $\Vert f\Vert_{\infty}\leq M$ and that is has countable infinitely many points where it is discontinuous.
Show that $f$ is Riemann-integrable by using upper- and lower Riemann sums.
(Hint: think of a clever partition)
My approach:
We know that the tail of $\sum\limits_{k=1}^{\infty}\frac{1}{2^k}$ gets arbitrarily small. So we choose $n_0\in\mathbb{N}$ such that $\sum\limits_{k=n_0}^{\infty}\frac{1}{2^k}<\frac{\epsilon}{2M}$. Next, we define two sets: one covers all discontinuities $d_k$ with open intervals $$ D:=\bigcup\limits_{k=1}^{\infty}\left(d_k-\frac{1}{2^{n_0+k+1}},~d_k+\frac{1}{2^{n_0+k+1}}\right) $$ and the other $$ C:=\{x\in[a,b]\mid f\text{ is continuous at } x\}. $$ It's obvious that $C$ and $D$ are open and $[a,b]\subseteq\left(C\cup D\right)$ (Note that $C\neq \emptyset$). As $[a,b]$ is a compact set in $\mathbb{R}$ there exists a finite cover of $[a,b]$ which attains the form of $$C\cup \bigcup\limits_{k=1}^{n}\left(d_k-\frac{1}{2^{n_0+k+1}},~d_k+\frac{1}{2^{n_0+k+1}}\right).$$
Now we take all end points $d_k-\frac{1}{2^{n_0+k+1}}$ and $d_k+\frac{1}{2^{n_0+k+1}}$ of those $n$-many open itervals, denote them by $t'_j$ and use them as labels for a partition $P$ of $[a,b]$. If some of the intervals $\left(d_k-\frac{1}{2^{n_0+k+1}},~d_k+\frac{1}{2^{n_0+k+1}}\right)$ intersect each other we simply omit one point. So we get $P=(a,t'_1,t'_2,\cdots,t'_n,b)$.
Now consider an interval $[t'_{j-1},t'_j]$ of $P$. If $t'_{j-1}$ is a start point or $t'_j$ is an end point of any interval of $\bigcup\limits_{k=1}^{n}\left(d_k-\frac{1}{2^{n_0+k+1}},~d_k+\frac{1}{2^{n_0+k+1}}\right)$ then $f$ is not continuous on $[t'_{j-1},t'_j]$. Otherwise it is because $[t'_{j-1},t'_j]$ doesn't contain any discontinuity. Moreover, in this case $f$ would be uniformly continuous on $[t'_{j-1},t'_j]$ which means that $f$ would be uniformly continuous on finitely many intervals $[t'_{j-1},t'_j]$.
This means that we get a $\delta>0$ such that for all $x,y$ which lie in those intervals we have $|f(x)-f(y)|<\frac{\epsilon}{2(b-a)}$. Now, we simply refine those intervals on which $f$ might be continuous such that the distance of the lables doesn't exceed $\delta$. This get's us a new partition $P^*$ which consists of two groups of labels: one forms intervals on which $f$ is uniformly continuous and the other one forms intervals where $f$ isn't continuous.
If we consider the Riemann sums we get: \begin{align*} &U(f,P^*)-L(f,P^*)\\ &=\sum\limits_{\underset{\text{on }[t_{i-1},t_i]}{f\text{ is continuous}}}(\sup_{[t_{i-1},t_i]}-\inf_{[t_{i-1},t_i]})(t_i-t_{i-1})+\sum\limits_{\underset{\text{on }[t_{i-1},t_i]}{f\text{ is not continuous}}}(\sup_{[t_{i-1},t_i]}-\inf_{[t_{i-1},t_i]})(t_i-t_{i-1})\\ &\leq \frac{\epsilon}{2(b-a)}(b-a)+M\frac{\epsilon}{2M}=\epsilon. \end{align*} As this holds for any partition with a higher refinement than $P^*$ it follows that $f$ is Riemann integrable.
Is my proof correct? I am a bit unsure if I can use the set $C$ and if it is sufficient to describe the process of refinement as I did it. Any suggestions are welcome :)
PS: I know that there already exist related questions (see for example here: Proof that a function with a countable set of discontinuities is Riemann integrable without the notion of measure) but I would like to get some feedback on my approach.