Find the period of a function $\varphi:\mathbb{R}\backslash\{3\}\to \mathbb{R}$ Let $\varphi:\mathbb{R}\backslash\{3\}\to \mathbb{R}$ a periodic function so that forall $x\in \mathbb{R}$ $$\varphi(x+4)=\frac{\varphi(x)-5}{\varphi(x)-3}$$ Find the period the $\varphi$.
 A: With $f(x) = \frac{x-5}{x-3}$ the functional equation can be written
$$\varphi(x+4) = f\circ \varphi(x)$$
A direct calculation shows that
$$f\circ f\circ f\circ f = \text{Id} \implies \varphi(x+16) = \varphi(x)$$
which implies that the period satisfy $T = \frac{16}{m}$ for some $m\in\mathbb{N}$. We can rule out $4\mid m$ as a possibillity since 
$$f\circ \varphi(x) = \varphi(x+4) = \varphi\left(x+ T \cdot \frac{m}{4}\right) = \varphi(x)\implies \varphi(x) = 2\pm i \not\in\mathbb{R}$$
and we can also rule out $m \equiv 2\pmod 4$ by the same type of argument.
The remaining values $m\equiv \pm 1\pmod{4}$ are all possible and we can prove this by explcitly constructing solutions with the desired period. The form of the equation looks similar to the addition formula for $\tan(x+y)$ so taking the ansatz $\varphi(x) = A\tan(kx) + B$ in the functional equation and solving for $A,B,k$ we find the following family of solutions
$$\varphi(x) = \tan\left(\frac{\pi x}{T}\right)+2$$
where $T = \frac{16}{4n\pm 1}$ with $n\in\mathbb{N}$.
A: Defining $f(x) = {x - 5\over x-3}$, we have $\varphi(x + 4) = f(\varphi(x))$. More generally, $\varphi(x + 4k) = f^{(k)}(\varphi(x))$. Assuming that the period is a multiple of $4$, for some $k$, $\varphi(x) = y = f^{(k)}(y)$.
I suspect the trick is to find a value of $k$ such that $y = f^{(k)}(y)$ has real solutions.
