Given Abel's Identity according to Apostol [1] it follows that,
$\sum_{y <n\leq y} a(n) f(n) = A(x) f(x) - A(y) f(y) - \int\limits_y^{x} A(t) f'(t) dt\quad\quad\quad$
where $A(x) = \sum_{n\leq y} a(n)$
I am having trouble understanding some steps in the proof namely line 4, 5 & 6 below that concerns the Riemann sum to integral that he performs; I cannot understand how he transforms the sum to integral shown in $\color{blue} {blue}$ in the following proof:
PROOF. Let $k=[x]$ and Let $m=[y]$ so that $A(x)=A(k)$ and $A(y)=A(m).$
Then
$$\sum_{y <n\leq x} a(n) f(n) = \sum_{n=m+1}^{k} a(n) f(n) = \sum_{n=m+1}^{k} [A(n)-A(n-1)] f(n)$$
$$= \sum_{n=m+1}^{k} A(n) f(n)-\sum_{n=m}^{k-1} A(n) f(n+1)$$
$$= \sum_{n=m+1}^{k-1} A(n) [f(n)-f(n+1)] + A(k) f(k) - A(m) f(m+1)$$
$$= -\sum_{n=m+1}^{k-1} A(n) \color{blue}{\int_n^{n+1} f(t)'dt} + A(k) f(k) - A(m) f(m+1)$$
$$= -\sum_{n=m+1}^{k-1} \color{blue}{\int_n^{n+1} A(t)f(t)'dt} + A(k) f(k) - A(m) f(m+1)$$
$$= - \color{blue}{\int_{m+1}^{k} A(t)f(t)'dt} + A(x) f(x) - \color{blue}{\int_{k}^{x} A(t)f(t)'dt} - A(y)f(y) - \color{blue}{\int_{y}^{m+1} A(t)f(t)'dt}$$
$$= A(x) f(x) - A(y) f(y) - \int\limits_y^{x} A(t) f'(t) dt$$
[1] Apostol page 77 "Tom M. Apostol-Introduction to Analytic Number Theory-Springer (1976)
There is a minor mistake in your definition of $A(x)$, it should be
$$A(x) = \sum_{n \le \color{red}x} a(n)$$
From the third line to the fourth line, it is due to
$$\int_n^{n+1}f(t)' \,dt = f(n+1)-f(n) $$
From the fourth line to the fifth line, it is due to
$$\forall t \in [n, n+1), A(t) = A(n) $$
Hence
$$\int_n^{n+1} A(t) f(t)' \, dt= \int_n^{n+1} A(n) f(t)' \, dt = A(n)\int_n^{n+1} f(t)' \, dt.$$
From the fifth line to the sixth line, the first term is just
$$\sum_{n=m+1}^{k-1} \int_n^{n+1} A(t)f(t)' \, dt = \int_{m+1}^k A(t) f(t)' \, dt$$
We are just splitting the integral up.
The second and third term is due to
$$\forall t \in [k,x], A(t)=A(k)=A(x),$$
Hence
$$\int_k^x A(t) f(t)' \, dt = A(k) \int_k^x f(t)' dt = A(k) [f(x)-f(k)]=A(k)f(x)-A(k)f(k)=A(x)f(x)-A(k)f(k).$$
For the fourth and fifth term, it is due to
$$\forall t \in [y, m+1), A(t) = A(y)=A(m),$$
Hence,
$$\int_y^{m+1} A(t)f(t)' \, dt = A(y) \int_y^{m+1 } f(t)' \, dt = A(y) [f(m+1)-f(y)]=A(m)f(m+1)-A(y)f(y)$$