With the Lebesgue's theory, your claim is just a comment that follows a sequence of observations after the definition of integrable function.
I recall this exercise from early courses. So, I think that the OP talks about the Riemann integral. As I said in the comments, all the reasoning with the inequalities is correct provided that we are working with Riemann integrable functions. Let me see why this is the case.
Theorem If $f$ is Riemann integrable in $[a,b]$, then $|f|$ is Riemann integrable in $[a,b]$.
Proof. Let $P=\{a=x_0,\ldots x_n=b\}$ a partition of $[a,b]$. For each $k\in \{1,\ldots,n\}$ let $M_k(f)=\sup f([x_{k-1},x_k])$ and $m_k(f)=\inf f([x_{k-1},x_k])$. Then we have
$$\begin{align*}
M_k(|f|)-m_k(|f|)&=\sup \{|f(x)|-|f(y)|:x,y\in [x_{k-1},x_k]\}\tag{1}\\
&\leq \sup \{|f(x)-f(y)|:x,y\in [x_{k-1},x_k]\}\\
&= M_k(f)-m_k(f),
\end{align*}$$
multiplying both sides by $x_k-x_{k-1}$ and summing over $k$ we get
$$0\leq U(P,|f|)-L(P,|f|)\leq U(P,f)-L(P,f).$$
Since $f$ is integrable, we can do the difference between the upper and lower sums as small as we want by taking the correct partitions. The above inequality shows that we can do the same with the upper and lower sums of $|f|$, and that implies that $|f|$ is integrable in $[a,b]$.
To see why $(1)$ holds, pick $k\in\{1,\ldots,n\}$. For each $x,\ y\in[x_{k-1},x_k]$, we know that
$$M_k(|f|)\geq |f(x)|\qquad\text{and}\qquad -m_k(|f|)\geq -|f(y)|.$$
So $$M_k(|f|) - m_k(|f|)\geq |f(x)| - |f(y)|\qquad \forall x,y\in [x_{k-1},x_k],$$
$$M_k(|f|) - m_k(|f|)\geq \sup\{|f(x)| - |f(y)| : x,y\in [x_{k-1},x_k]\}.$$
In the other hand, by the properties of the sup, for each $j\in\mathbb N$, there are $x_j\ y_j\in [x_{k-1},x_k]$ such that
$$\sup\{|f(x)| - |f(y)| : x,y\in [x_{k-1},x_k]\} - \frac 1j \leq |f(x_j)| - |f(y_j)|,$$
but $|f(x_j)| - |f(y_j)|\leq M_k(|f|) - m_k(|f|)$ for each $j$ as we saw above, so we get
$$\sup\{|f(x)| - |f(y)| : x,y\in [x_{k-1},x_k]\} - \frac 1j \leq M_k(|f|) - m_k(|f|)\qquad \forall j\in\mathbb N,$$
thus
\begin{align*}
\lim_{j\to\infty} \left(\sup\{|f(x)| - |f(y)| : x,y\in [x_{k-1},x_k]\} - \frac 1j\right) &\leq M_k(|f|) - m_k(|f|)\\
\sup\{|f(x)| - |f(y)| : x,y\in [x_{k-1},x_k]\} &\leq M_k(|f|) - m_k(|f|).
\end{align*}
Therefore, $(1)$ holds for each $k\in\{1,\ldots,n\}$.