Function composition to show identity I have a mapping $f:S\rightarrow S$ where
$$f(s)=\frac{as+b}{cs+d}$$
where $S=\mathbb{R}^+, a,c\in\mathbb{R}^+ $ and $b,d\in\mathbb{R}/\mathbb{R}^-$ 
I need to find the necessary and sufficient conditions such that $f\circ f=i_s$, where $i_s$ is the identity mapping $f(s)=s$
If I compose the functions, i get
$$f\circ f=\frac{a\frac{as+b}{cs+d}+b}{c\frac{as+b}{cs+d}+d}=\frac{(a^2+bc)s+(ab+bd)}{(ac+cd)s+(bc+d^2)}$$
There are a number of conditions to satisfy here.  Looking at the denominator, I really need this to be $1$.  This implies that 
$$ac+cd=\frac1{s}, bc+d^2=0$$
Or
$$ac+cd=0, bc+d^2=1$$
In addition, I need that
$$a^2+bc=1, ab+bd=0$$
in order that the numerator be of the form $1s+0=s$
Am i on the right track?  Is there an easier way to view this problem, or is this kind of analysis "spot on" and just continue plugging away?  I'm not really looking for a definitive answers on all possible values of $a,b,c,d$, just a confirmation that this is the correct or incorrect approach.
 A: Here's the easier way to view this: given two functions
$$
f(s) = \frac{as + c}{bs + d}\qquad g(s) = \frac{a's + c'}{b's + d'}
$$
Denote the matrices
$$
M_f = \pmatrix{a & b\\c & d} \qquad M_g = \pmatrix{a' & b'\\ c' & d'}
$$
Now, suppose the product of these matrices is $M_fM_g = N = \pmatrix{m & n\\p & q}$.  We then have
$$
f(g(s)) = \frac{ms + n}{ps + q}
$$
We also note that $f(s) = s$ exactly when $M_f$ is a (non-zero) multiple of the identity matrix, $I = \pmatrix{1&0\\0&1}$.

So, in order to find the set of $f$ such that $f \circ f = i$, it suffices to find the set of matrices $M$ such that $M^2 = \lambda \, I$ for $\lambda \in \mathbb{C}$.  It ends up that the matrices that work here are the multiples of the identity matrix and matrices whose eigenvalues are $\pm \mu$ for $\mu \neq 0$.  This second set of matrices is exactly the set of invertible $2 \times 2$ matrices whose trace is $0$.
So, long story short, some necessary and sufficient conditions are:


*

*$ad - cd \neq 0$

*$a = d$ and $b=c=0$ OR $a + d = 0$

