Showing a function increasing I was solving exercises from the book Real Analysis by Carothers. I am having trouble in solving Problem 36 of Exercise of chapter 2 on page 33. I am actually very poor in producing $\epsilon-\delta$ arguments and I guess the problem may need this kind of arguments. Please help me. Thnx in advance.
Here is the problem.

Let $f:[a,b]\to \mathbb R$ be an increasing function and let $\{x_n\}$ be an enumeration of discontinuities of $f$. Define, for all $n$, $a_n = f(x_n)-f(x_n-) \text{ and } a_n=0 \text{ if }x_n=a $, $b_n = f(x_n+)-f(x_n) \text{ and } b_n=0 \text{ if }x_n=b $ Now define $h(x)= \sum_{x_n\le x}a_n+ \sum_{x_n< x}b_n$ . Show that $h$ is increasing and $f-h$ is both continuous and increasing.

Now frankly speaking I am very little comfortable with $f(x_n+),f(x_n-)$ notations and there are so much information in the question , I am puzzled from where I should start. I am not finding a way. I am completely stuck.
I apologise for not showing a good effort from my end. I am really sorry.
Please help me to solve this problem. Thanks again.
 A: In the comments we found out that we have $a_n \geqslant 0$ and $b_n \geqslant 0$ for all $n$, since $f$ is increasing. If $x < x_n$ we have $f(x) \leqslant f(x_n)$ by the monotonicity, and then
$$f(x_n^-) = \lim_{\substack{x\to x_n \\ x < x_n}} f(x) = \sup \{ f(x) : x < x_n\}$$
follows. Then the monotonicity of $h$ follows easily: for $x < y$ we have
$$h(y) - h(x) = \Biggl(\sum_{x_n \leqslant y} a_n + \sum_{x_n < y} b_n\Biggr) - \Biggl(\sum_{x_n \leqslant x} a_n + \sum_{x_n < x} b_n\Biggr) = \sum_{x < x_n \leqslant y} a_n + \sum_{x \leqslant x_n < y} b_n \geqslant 0.$$
Now it remains to show that $g := f - h$ is continuous and increasing.
For the continuity, note that $g$ is continuous at $x\in (a,b)$ if and only if
$$\lim_{\substack{y \to x \\ y < x}} g(y) = g(x^-) = g(x) = g(x^+) = \lim_{\substack{y\to x \\ y > x}} g(y),$$
and it is continuous at $a$ if and only if $g(a^+) = g(a)$, and at $b$ if and only if $g(b^-) = g(b)$.
In particular, all the one-sided limits must exist. But the one-sided limits of $\varphi$ exist at every point of the domain of $\varphi$ if $\varphi$ is a monotonic function (increasing or decreasing), and if the one-sided limits $\varphi(x^+)$ and $\psi(x^+)$ exist for two functions $\varphi$ and $\psi$ defined at least on $[x,x+\delta)$ for some $\delta > 0$, then the right limit of $\varphi - \psi$ at $x$ exists and $(\varphi - \psi)(x^+) = \varphi(x^+) - \psi(x^+)$. The analogous assertion holds for left limits, of course. So we know that all one-sided limits of $g$ exist, and we need to check whether we have $g(x^-) = g(x) = g(x^+)$ for all $x\in [a,b]$ (where we define $g(a^-) = g(a)$ and $g(b^+) = g(b)$ so that the chain of equations makes sense also for these $x$). But
$$g(x^+) - g(x) = \bigl(f(x^+) - h(x^+)\bigr) - \bigl(f(x) - h(x)\bigr) = \bigl(f(x^+) - f(x)\bigr) - \bigl(h(x^+) - h(x)\bigr),$$
and similarly for the left limits, so the continuity of $f - h$ is equivalent to the equalities $f(x^+) - f(x) = h(x^+) - h(x)$ and $f(x) - f(x^-) = h(x) - h(x^-)$ for all $x\in [a,b]$. Thus you need to show $h(x_n) - h(x_n^-) = a_n$ and $h(x_n^+) - h(x_n) = b_n$ for all $n$, and $h(x^-) = h(x) = h(x^+)$ for all $x$ that are none of the $x_n$ (for the points of continuity of $f$). It might be helpful to split $h$ into
$$h_r(x) = \sum_{x_n \leqslant x} a_n\quad \text{and} \quad h_l(x) = \sum_{x_n < x} b_n.$$
Finally, to show that $f - h$ is increasing, you need to show that for $x < y$ we have
$$f(y) - f(x) \geqslant h(y) - h(x).$$
We know $h(y) - h(x)$ from above, and to show the inequality, it is useful to note that since $f$ is increasing, we have, for all partitions $x = t_0 < t_1 < \dotsc < t_{k-1} < t_k = y$,
$$f(y) - f(x) = \sum_{\kappa = 1}^k \bigl(f(t_\kappa) - f(t_{\kappa - 1})\bigr).$$
A judiciously chosen sequence of partitions helps establishing the inequality using
$$\sum_{x < x_n \leqslant y} a_n = \lim_{m\to \infty} \sum_{\substack{x < x_n \leqslant y \\ n \leqslant m}} a_n$$
and the similar limit for the other sum.
