(a) If $f(x)=\frac{x}{x-1}$ for $x \neq 1$, determine all real numbers $r \neq 1$ for which $f(r)=r$.

(b) If $f(x)=\frac{x}{x-1}$ for $x \neq 1$, show that $f(f(x))=x$ for all real numbers $x \neq 1$.

(c) Suppose that $k$ is a real number. Define $g(x)=\frac{2 x}{x+k}$ for $x \neq-k$. Determine all real values of $k$ for which $g(g(x))=x$ for every real number $x$ with $x \neq-k$ and $g(x) \neq-k$.

(d) Suppose that $a, b$ and $c$ are non-zero real numbers. Define $h(x)=\frac{a x+b}{b x+c}$ for $x \neq-\frac{c}{b}$. Determine all triples $(a, b, c)$ for which $h(h(x))=x$ for every real number $x$ with $x \neq-\frac{c}{b}$ and $h(x) \neq-\frac{c}{b}$.
(a) If $f(r)=r$, then $\frac{r}{r-1}=r$.

Since $r \neq 1$, then $r=r(r-1)$ or $r=r^{2}-r$ or $0=r^{2}-2 r$ and so $0=r(r-2)$.

Thus, $r=0$ or $r=2$.

We can check by substitution that each of these values of $r$ satisfies the original equation.

(b) Since $f(x)=\frac{x}{x-1}$, then

$$
f(f(x))=\frac{\frac{x}{x-1}}{\frac{x}{x-1}-1}=\frac{x}{x-(x-1)}=\frac{x}{1}=x
$$

as required.

(Note that above we have multiplied both the numerator and denominator of the complicated fraction by $x-1$, which we can do since $x \neq 1$.)

(c) When $x \neq-k, g(x)=\frac{2 x}{x+k}$ is well-defined.

When $x \neq-k$ and $g(x) \neq-k, g(g(x))=\frac{2\left(\frac{2 x}{x+k}\right)}{\frac{2 x}{x+k}+k}$ is well-defined.

The following equations are equivalent for all $x$ with $x \neq-k$ and $g(x) \neq-k$ :

$$
\begin{aligned}
g(g(x)) & =x \\
\frac{2\left(\frac{2 x}{x+k}\right)}{\frac{2 x}{x+k}+k} & =x \\
\frac{4 x}{2 x+k(x+k)} & =x \quad(\text { multiplying numerator and denominator by } x+k) \\
4 x & =x(2 x+k(x+k)) \\
4 x & =x\left(2 x+k x+k^{2}\right) \\
4 x & =(k+2) x^{2}+k^{2} x \\
0 & =(k+2) x^{2}+\left(k^{2}-4\right) x \\
0 & =(k+2)\left(x^{2}+(k-2) x\right)
\end{aligned}
$$

Since there are values of $x$ for which $x^{2}+(k-2) x \neq 0$, then to have $(k+2)\left(x^{2}+(k-2) x\right)=0$ for all $x$, we need to have $k+2=0$, or $k=-2$. (For example, if $k=1$, the equation would become $3\left(x^{2}-x\right)=0$ which only has the two solutions $x=0$ and $x=1$.)

Therefore, $g(g(x))=x$ for all $x$ with $x \neq-k$ and $g(x) \neq-k$ exactly when $k=-2$.

(d) When $x \neq-\frac{c}{b}, h(x)=\frac{a x+b}{b x+c}$ is well-defined.

When $x \neq-\frac{c}{b}$ and $h(x)=\frac{a x+b}{b x+c} \neq-\frac{c}{b}, h(h(x))=\frac{a\left(\frac{a x+b}{b x+c}\right)+b}{b\left(\frac{a x+b}{b x+c}\right)+c}$ is well-defined.

The following equations are equivalent for all $x$ with $x \neq-\frac{c}{b}$ and $h(x) \neq-\frac{c}{b}$ :

$$
\begin{aligned}
h(h(x)) & =x \\
\frac{a\left(\frac{a x+b}{b x+c}\right)+b}{b\left(\frac{a x+b}{b x+c}\right)+c} & =x \\
\frac{a(a x+b)+b(b x+c)}{b(a x+b)+c(b x+c)} & =x \quad \text { (multiplying numerator and denominator by } b x+c) \\
a(a x+b)+b(b x+c) & =x(b(a x+b)+c(b x+c)) \\
\left(a^{2}+b^{2}\right) x+(a b+b c) & =(a b+b c) x^{2}+\left(b^{2}+c^{2}\right) x \\
0 & =b(a+c) x^{2}+\left(c^{2}-a^{2}\right) x-b(a+c)
\end{aligned}
$$

Since this "quadratic equation" is satisfied for infinitely many real numbers $x$, then it must be the case that all three of its coefficients are 0 .

In other words, we must have $b(a+c)=0$ and $c^{2}-a^{2}=0$, and $b(a+c)=0$.

Since $b \neq 0$, then $b(a+c)=0$ gives $a+c=0$ or $c=-a$.

Note that if $c=-a$, then $c^{2}-a^{2}=0$ and $b(a+c)=0$ as well.

Therefore, $h(h(x))=x$ for all triples $(a, b, c)$ of the form $(a, b,-a)$ where $a$ and $b$ are non-zero real numbers.