I know how to solve the following problem assuming a supplementary condition(that a function is differentiable).
The problem: Let $a$ and $b$ be real numbers in the interval $(0, +\infty)$ and $f : [a, b] \to [0, b]$ a bijective and continuous function and $f(0)=0$. Show that $$\int_0^a f(x)dx+\int_0^b f^{-1}(x)dx=ab$$ where $f^{-1}$ is the inverse function of $f$.
This is my approach.
$f$ is a continuous function therefore it has the intermediate value property. The function is bijective and it is continuous so, in particular, it is injective. Therefore, the function is monotone. The function is increasing because the codomain has positive values. What I mean is that if we take $x \in [0, a] \implies f(x) \in [0, b] \implies 0 \le f(x)$. Since $0 \le x \implies f(0) \le f(x)$ it means that f has to be increasing. $f$ is continuous and increasing therefore, the extreme value theorem says that $f(a)=b$.
Now, I would assume that $f$ is differentiable, so I can use the substitution $u=f^{-1}(x)$ on the second integral. Therefore, $x=f(u) \implies dx=f'(u)du$. So, $$\int_0^b f^{-1}(x)dx=\int_0^a uf'(u)du=uf(u)\biggr \rvert_{0}^{a}-\int_0^a f(u)du$$ Therefore, the sum of the two integrals is $ab$. However, I don't know how to deal with the case where $f$ is not differentiable. Can we assume this? Because I have found counterexamples, like $f(x)=x$ for $x \in [0, 1]$ and $f(x)=2x-1$ for $x \in (1, 2]$. This function is not differentiable at $x=1$, but is both continuous and bijective. And with the same reasoning we can create a function that has a countable set of points where the function is not differentiable, like $f(x)=\frac{1}{n}x+c_n$ for $x \in [\frac{1}{n}, \frac{1}{n+1}]$ and we find $c_n$ such that the function is continuous. Is it safe to assume that the function is differentiable, and if yes why?
Edit: I wrote some ambiguous things and I corrected them
