$\def\d{\mathrm{d}}$If $f:\mathbb{R}\rightarrow \mathbb{R}$ and $f(x)=x+\cos x$, find$$\int^{\pi}_{0}f^{-1}(x) \,\d x.$$
Try: put $x=f(t)$ and $\d x=f'(t) \,\d t$, so \begin{align*} \int^{f^{-1}(\pi)}_{f^{-1}(0)}tf'(t) \,\d t &=\int^{f^{-1}(\pi)}_{f^{-1}(0)}t(1-\sin t) \,\d t\\ &= \left.\left(t \cos t-\sin t+\frac{t^2}{2}\right)\right|^{f^{-1}(\pi)}_{f^{-1}(0)}. \end{align*}
Could someone help me how to find $f^{-1}(\pi)$ and $f^{-1}(0)$, thanks.

Since $\cos(\pi-x)=-\cos x$, we have $$f(\pi-x)=\pi-f(x).$$ Applying $f^{-1}$ to both sides and replacing $x$ by $f^{-1}(x)$, this gives $$f^{-1}(\pi-x)=\pi-f^{-1}(x).$$ Then, $$\int^\pi_0f^{-1}(\pi-x)\,dx=\int^\pi_0(\pi-f^{-1}(x))\,dx.$$ The substitution $x\to\pi-x$ on the LHS gives $$\int^\pi_0f^{-1}(x)\,dx=\pi^2-\int^\pi_0f^{-1}(x)\,dx,$$ i.e. $$\int^\pi_0f^{-1}(x)\,dx=\frac{\pi^2}2,$$ as @Patrick Stevens guessed from numerical calculation in a comment, already.
REMARK: originally, I started with $x_0=f^{-1}(0)$, and found that then, we must have $f^{-1}(\pi)=\pi-x_0$. If we plug both values into the expression given by the OP and use $\sin(\pi-x_0)=\sin x_0$, $\cos x_0=-x_0$ and $\cos(\pi-x_0)=x_0$, it miraculously simplifies to $\pi^2/2$. Thinking about "why?", I came up with the above.