A better proof on the integrability criterion In almost all analysis textbooks, the criterion for integrability is stated as this: $f$ is integrable if and only if for any $\epsilon>0$, there exists a partition $\mathcal{P}$ such that $U(f,\mathcal{P})-L(f,\mathcal{P})<\epsilon$.
Which just means:
$\sup\{L(f,\mathcal{P})\}=\inf\{U(f,\mathcal{P})\}\iff\forall\epsilon>0\exists\mathcal{P}:U(f,\mathcal{P})-L(f,\mathcal{P})<\epsilon$
Yet the proof they give on this theorem is quite unclear. So I tried to revise it and added more details, here is my work(In the following proof, I assume you have known the properties of supremum and infimum, and $\inf\{-S\}=-\sup\{S\}$):
We first prove this direction:
\begin{equation*}
\sup\{L(f,\mathcal{P})\}=\inf\{U(f,\mathcal{P})\}\Rightarrow\forall\epsilon>0\exists\mathcal{P}:U(f,\mathcal{P})-L(f,\mathcal{P})<\epsilon 
\end{equation*}
Let $a=\sup\{L(f,\mathcal{P})\}=\inf\{U(f,\mathcal{P})\}$. By the definition of supremum and infimum, we know, for any partition $\mathcal{P}$, there is
\begin{align*}
L(f,\mathcal{P})\leq a\\
a\leq U(f,\mathcal{P})
\end{align*}
And, for any $\epsilon>0$, there always exists a partition $\mathcal{P}$ such that
\begin{align*}
L(f,\mathcal{P})>a-\frac{\epsilon}{2}\\
a+\frac{\epsilon}{2}>U(f,\mathcal{P})
\end{align*}
\begin{equation*}
\Downarrow 
\end{equation*}
\begin{align*}
U(f,\mathcal{P})<a+\frac{\epsilon}{2}\\
-L(f,\mathcal{P})<-a+\frac{\epsilon}{2}
\end{align*}
\begin{equation*}
\Downarrow 
\end{equation*}
\begin{equation*}
U(f,\mathcal{P})-L(f,\mathcal{P})<a+\frac{\epsilon}{2}-a+\frac{\epsilon}{2}=\epsilon 
\end{equation*}
So we derived what we desire. Now we try to prove the inverse direction, which is \begin{equation*}
\forall\epsilon>0\exists\mathcal{P}:U(f,\mathcal{P})-L(f,\mathcal{P})<\epsilon\Rightarrow\sup\{L(f,\mathcal{P})\}=\inf\{U(f,\mathcal{P})\}
\end{equation*}
Notice for any partition,
\begin{equation*}
0<U(f,\mathcal{P})-L(f,\mathcal{P})
\end{equation*}
Combine this with the given condition, we see
\begin{equation*}
\inf\{U(f,\mathcal{P})-L(f,\mathcal{P})\}=0\Rightarrow\inf\{U(f,\mathcal{P})\}+\inf\{-L(f,\mathcal{P})\}=0
\end{equation*}
\begin{equation*}
\Downarrow 
\end{equation*}
\begin{equation*}
\inf\{U(f,\mathcal{P})\}-\sup\{L(f,\mathcal{P})\}=0\Rightarrow\sup\{L(f,\mathcal{P})\}=\inf\{U(f,\mathcal{P})\}
\end{equation*}
Is there anything I can improve?
 A: For the first part of your argument, you say

For any $\epsilon>0$, there exists a partition $\mathcal P$ such that
\begin{align*}
L(f,\mathcal P) &> a-\epsilon/2\\
a+\epsilon/2 &> U(f,\mathcal P)
\end{align*}
$\dots\dots\dots$

You should note that the definitions only guarantee there exist two separate partitions $\mathcal P_L$ to guarantee the first line, and $\mathcal P_U$ to guarantee the second line, and we don't necessarily have $\mathcal P_L=\mathcal P_U$. To do this properly, you should take the common refinement of $\mathcal P_L,\mathcal P_U$ as your $\mathcal P$. This requires an additional lemma that taking refinements only improves things, but is necessary to at least mention, if not prove.
For the second part of your argument, you write

$$\inf\{U(f,\mathcal P)-L(f,\mathcal P)\} = 0 \implies \inf\{U(f,\mathcal P)\}+\inf\{-L(f,\mathcal P)\} = 0$$
$\dots\dots\dots$

To me, it seems like you are saying that $\inf\{U(f,\mathcal P)-L(f,\mathcal P)\} = \inf\{U(f,\mathcal P)\}+\inf\{-L(f,\mathcal P)\}$. In general, taking infimum of a sum is not the same as taking the sum of the infima of the summands, so I think you should prove this to be complete, or else otherwise fill in your argument with some description of how exactly you are getting this implication. As a matter of style/general rule of thumb, writing in complete sentences with some explanation of what you are doing in proofs is preferable to listing strings of implication arrows.
The rest of the argument looks complete to me!
