I'm reading this answer
I report it for completeness:
Let $C$ be the graph of $v = f(u)$ over the interval $[0,f^{-1}(b)]$. If $f(a) > b$, then $f^{-1}(b) < a$, in which case
\begin{align}\int_0^a f(x)\, dx + \int_0^b f^{-1}(x)\, dx &= \int_0^{f^{-1}(b)} f(x)\, dx + \int_0^b f^{-1}(x)\, dx + \int_{f^{-1}(b)}^a f(x)\, dx\\&= \int_C u\, dv + v\, du + \int_{f^{-1}(b)}^a f(x)\, dx\\&= \int_C d(uv) + \int_{f^{-1}(b)}^a f(x)\, dx\\&= bf^{-1}(b) + \int_{f^{-1}(b)}^a f(x)\, dx\\&> bf^{-1}(b) + b(a - f^{-1}(b))\\&= ab\end{align}
Similarly if $f(a) < b$, then $\int_0^a f(x)\, dx + \int_0^b f(x)\, dx > ab$. If $f(a) = b$, then $$\int_0^a f(x)\, dx + \int_0^b f^{-1}(x)\, dx = \int_C u\, dv + v\, du = \int_C d(uv) = af(a) = ab.$$
It is known that a monotone function is differentiable almost everywhere.
In class I heard that in this case the points of non-differentiability of $f$ are finite. Is this true?