The problem suggests doing it by showing that $U(P,|f|) - L(P,|f|) \le U(P,f)-L(P,f)$ for some partition $P$. I can get the other steps after that, but I've tried proving this inequality on my own and multiple tutors at my university couldn't figure it out using the material in my book. Every time I've attempted it on my own, I've gotten the arrow in the opposite direction. Doesn't $\displaystyle\sup_{i \in [x_{i-1},x_i]} |f(x)| \ge \displaystyle\sup_{i \in [x_{i-1},x_i]} f(x)$ hold?
Note that my class is using a pretty simplified Analysis (question 5.5.2a) book that doesn't cover metric spaces or Lebesgue integrals. Everything is Riemann and we show a function is Riemann integrable if and only if its upper and lower Darboux integrals are equal.
It is enough to show that if $I$ is any subinterval of $[a,b]$, then $$\sup_I\vert f\vert-\inf_I\vert f\vert\leq \sup_I f-\inf_I f\, . $$ If this is done then, given any partition $P$, apply this inequality to each interval $I$ of the partition, multiply by $\vert I\vert$ and and then sum everything to get $U(P,\vert f\vert)-L(P,\vert f\vert)\leq U(P,f)-L(P,f)$.
So let us fix the interval $I$. One may distinguish 3 cases.
If $\inf_I f\geq 0$, then $f\geq 0$ on $I$ so $\inf_I \vert f\vert=\inf_I f$ and $\sup_I\vert f\vert =\sup_I f$ and hence $\sup_I\vert f\vert-\inf_I\vert f\vert= \sup_I f-\inf_I f$.
If $\sup_I f\leq 0$, then $f\leq 0$ on $I$, so $\inf_I \vert f\vert=-\sup_I f$ and $\sup_I\vert f\vert =-\inf_I f$ and hence $\sup_I\vert f\vert-\inf_I\vert f\vert= \sup_I f-\inf_I f$ again.
If $\inf_I f<0<\sup_I f$, then we have either $\sup_I\vert f\vert=\sup_I f$, in which case $\sup_I\vert f\vert-\inf_I\vert f\vert\leq \sup_I\vert f\vert=\sup_I f<\sup_I f-\inf_I f$; or $\sup_I \vert f\vert=-\inf_I f$, in which case $\sup_I\vert f\vert-\inf_I\vert f\vert\leq -\inf_I f< \sup_I f-\inf_I f$.