You are given that the funcion $\displaystyle f(x) = \frac{e^{cos x}-1}{2+e^{cos x}} $ is one-to-one when restricted on $\displaystyle [0,\pi]$

Find the domain of the inverse function of f, $\displaystyle x \epsilon [0,\pi]$

and find a formula for the inverse function.

I am totally stumped on this one.