Let $a$ be an element of $\mathbb{F}_p$, which is not a quadratic residue. Define $$f(x) = \frac{x - a}{x+1},$$ which is a rational function on $\mathbb{F}_p$. In fact, if we set $f(-1)=\infty$ and $f(\infty)=1$, then $f:\mathbb{F}_p\cup\{\infty\}\rightarrow \mathbb{F}_p\cup\{\infty\}$ is a bijection. What is the order of $f$ under the operation of composition? I expect that $f$ has order $p+1$, but I don't know how to prove it.