<s>[INST] Prove that $f \circ f (x) = x$ $$f(x) = \pi - \sqrt{1-a^2}\int_{0}^{x} \dfrac{dt}{1+\cos\,t}$$
Using that if $u = \tan \frac t2$, then $\cos\,t = \dfrac{1-u^2}{1+u^2}$
$u = \tan \frac t2 \Rightarrow t = 2 \arctan u \Rightarrow dt = \dfrac{2}{1+u^2} du$ 
substituting in the integral 
$$\int_0^{\tan \frac x2} \dfrac{2\,du}{(1+u^2)\left(1+\dfrac{1-u^2}{1+u^2}\right)}$$
$$= \int_0^{\tan \frac x2} du $$
Then: $$f(x) = \pi - \sqrt{1-a^2}\int_0^{\tan\frac x2}du = \pi - \sqrt{1-a^2}\tan \frac x2$$
but I can't see what I can do to prove that $f\circ f(x) = x$ ( I have tried with trignometric identities and get this ugly expression:
$$ \pi - \sqrt{1-a^2} \, \cot \left(\dfrac{\sqrt{1-a^2}}{2}\, \tan \frac x2 \right) $$
 [/INST] Something is wrong with your
definition of $f(x)$,
because,
if $a=1$ then $f(x) = \pi$ for all $x$,
so $f(f(x)) = \pi$ for all $x$.
In particular, it seems that the $a$ is out of place.
</s>