[guided]The purpose of removing the set $U$ is to isolate the only points where $f$ may fail to agree with a [continuous function](/page/Continuous%20Function) on a closed interval. Away from $U$, every sufficiently small subinterval sits entirely inside one continuity piece, so [uniform continuity](/page/Uniform%20Continuity) controls the oscillation.
Fix $k \in \{1,\dots,n\}$. The map
\begin{align*}
g_k: [x_{k-1},x_k] \to \mathbb{R}
\end{align*}
is continuous on a compact interval. Hence it is uniformly continuous: for the positive number
\begin{align*}
\frac{\varepsilon}{2(b-a)}
\end{align*}
there exists $\delta_k > 0$ such that for all $u,v \in [x_{k-1},x_k]$ with $|u-v| < \delta_k$,
\begin{align*}
|g_k(u)-g_k(v)| < \frac{\varepsilon}{2(b-a)}.
\end{align*}
We do this for every one of the finitely many pieces and set
\begin{align*}
\delta := \min\{\delta_1,\dots,\delta_n,\eta\}.
\end{align*}
The minimum is positive because it is the minimum of finitely many positive numbers.
Now construct a partition by starting with the finite set consisting of $a$, $b$, every breakpoint $x_j$, and every point of $[a,b]$ of the form $x_j-\eta$ or $x_j+\eta$. After discarding points outside $[a,b]$ and removing repetitions, list the remaining points in increasing order. If one of the resulting intervals has length at least $\delta$, subdivide it into finitely many equally spaced pieces, each of length less than $\delta$. This produces a partition
\begin{align*}
a = y_0 < y_1 < \cdots < y_m = b
\end{align*}
whose mesh satisfies
\begin{align*}
|P| := \max_{1 \leq r \leq m}(y_r-y_{r-1}) < \delta.
\end{align*}
Consider a subinterval
\begin{align*}
J_r := [y_{r-1},y_r]
\end{align*}
that is contained in $K=[a,b]\setminus U$. Because $J_r$ avoids the breakpoint neighborhoods and the partition includes all breakpoints, $J_r$ lies in exactly one continuity piece $[x_{k-1},x_k]$. On the interior of this piece, $f$ agrees with $g_k$, and no endpoint ambiguity from a breakpoint occurs because $J_r$ is away from $F$. Thus the oscillation of $f$ on $J_r$ is controlled by the oscillation of $g_k$ on the same interval.
For any $u,v \in J_r$, we have
\begin{align*}
|u-v| \leq y_r-y_{r-1} < \delta \leq \delta_k.
\end{align*}
Uniform continuity gives
\begin{align*}
|f(u)-f(v)| = |g_k(u)-g_k(v)| < \frac{\varepsilon}{2(b-a)}.
\end{align*}
Taking the supremum over $u \in J_r$ and the infimum over $v \in J_r$ yields
\begin{align*}
\sup_{x \in J_r} f(x) - \inf_{x \in J_r} f(x) \leq \frac{\varepsilon}{2(b-a)}.
\end{align*}
This is the exact estimate needed for the good part of Darboux's criterion: outside the finitely many breakpoint neighborhoods, every subinterval contributes only a small oscillation times its length. The remaining subintervals will be handled as bad intervals. We do not need them to be contained in $U$; it is enough that they intersect $U$, because the mesh bound $|P|<\eta$ places every such interval inside one of the enlarged neighborhoods $[a,b]\cap(x_j-2\eta,x_j+2\eta)$, whose total covering length was bounded earlier.[/guided]