AIME 1997, problem 12 Please have a look :

Problem
The function $f$ defined by $f(x)= \frac{ax+b}{cx+d}$, where $a$,$b$,$c$ and $d$ are nonzero real numbers, has the properties $f(19)=19$, $f(97)=97$ and $f(f(x))=x$ for all values except $\frac{-d}{c}$. Find the unique number that is not in the range of $f$.

The solution can be found here
It states, without proof, that if we have the functional equality:
$$\frac{px+q}{rx+s}=x$$  then $r=q=0.$
At the first solution, line $3$ why does it have to be $q = r = 0$? [ I understand that the opposite is true, i.e. , if $q = r = 0 $ then the fraction reduces to $x$ when $p = s$ ]
 A: Basically, a polynomial with infinitely many roots must be a zero polynomial.
If $\frac{px+q}{rx+s}=x$ for infinitey many $x$ then:
$$px+q=rx^2+sx$$ for infinitely many $x$, and thus:
$$rx^2+(s-p)x-q=0$$
for infinitely many $x.$ So this must be a zero polynomial, which means that $r=0,s-p=0,$ and $q=0.$
A: One way to come to this conclusion is to put different values of $x$. For example, putting $x=\pm 1$ in 
$$\frac{px + q}{rx + s}=x\tag{1}$$
results in $q+p=r+s$ and $q-p=r-s$ which imply $q=r$, and $p=s$. Similarly, plugging $x=0$ in $(1)$ results in $q=0$. As such, $r=q=0$.
A: Note that homographies are uniquely defined via a proportionality coefficient.
First remark that if $(ad-bc)=0$ or $k=\frac ac=\frac bd$ then $f(x)=\dfrac{ax+b}{cx+d}=\dfrac{kcx+kd}{cx+d}=k$
In the case the homography is not degenerated to a constant then
$\dfrac{ax+b}{cx+d}=\dfrac{Ax+B}{Cx+D}\iff (aC-Ac)x^2+(aD+bC-Ad-Bc)x+bD-Bd = 0$
You get two conditions $\begin{cases}aC=Ac\iff A=\lambda a,\ C=\lambda c\\
bD=Bd\iff B=\mu b,\ D=\mu d\end{cases}$
The central term then factorizes to $(\lambda-\mu)(ad-bc)x=0\iff \lambda=\mu$ since we are not in the degenerated case.
Finally you get that two homographies are equal only when their coefficients are all proportional with the same proportionality constant.
In our simple case $\dfrac{px+q}{rx+s}=x=\dfrac{1x+0}{0x+1}$ you get $q=0\lambda, r=0\lambda, p=1\lambda, s=1\lambda$
Or more simply $q=r=0$ and $p=s$.
