Evaluating Riemann Integral with finitely many different values of function at different points

Suppose $$f(x)$$ is defined as $$f(x) =\begin{cases} 1 & \text{ if } x= (a+b)/2 \\ 0 & \text{ otherwise.} \end{cases}$$ where $$f$$ is real valued function on $$I = [a,b]$$. I want to compute the Riemann Integral for this function on the interval $$I$$. To compute the Riemann Integral we need to compute upper and Lower Integral. $$\underline{\int_{a}^{b}} f dx = \sup_P \left\{\sum_{k=1}^n \mid I_k\mid \inf_{x\in I_k} f(x)\right\}$$ $$\forall x \in [a,b] \quad \inf_{x} =0$$ $$\underline{\int_{a}^{b}} f dx = 0$$ Let's compute Upper Reimann Integral $$\overline{\int_{a}^{b}} f dx = \inf_P \left\{\sum_{k=1}^n \mid I_k\mid \sup_{x\in I_k} f(x)\right\}$$ $$if \quad x= (a+b)/2$$ , $$\exists I_j$$ for which $$sup_{x\in I_j} =1$$ , $$x= (a+b)/2 \in I_j$$ $$\overline{\int_{a}^{b}} f dx = \mid I_j \mid$$ Let there are in $$n$$ partition, $$\mid I_j \mid = \frac {\mid b-a \mid} n$$ as $$n \rightarrow \infty$$ , $$\mid I_j \mid = 0$$ $$\overline{\int_{a}^{b}} f dx = 0$$ $$\overline{\int_{a}^{b}} f dx = \underline{\int_{a}^{b}} f dx = \int_{a}^{b} f dx =0$$ If there are $$m$$ values where $$f(x) =1$$ then $$m \frac {\mid b-a \mid} n$$ also tends to zero. Therefore, Riemann integral is equal to zero even if there are more than one different value of function at a single point. Is this correct reasoning to compute Riemann integral of $$f(x)$$?

It is a bit overcomplicated, but yes. Basically it is like this: A finite amount of points can be enclosed by a finite amount of intervals with arbitrarily small length. Thus (since $$f$$ is bounded) follows that they do not affect the riemann integral at all. Even countably many points can be enclosed in such a way, that the sum of the lengths of the intervals is arbitrarily small.
• But changing the function at countably many points may affect the Riemann integral. For example let $f(x)$ equal $1$ at the rational points of $[a, b]$ and equal $0$ at irrational points of $[a, b]$. Then $f$ is not Riemann integrable on $[a, b]$. Aug 28 '21 at 12:29