Lattice points of forward orbit of $z+z^{-1}$ are finite. Let $f(z) = z+\frac{1}{z}$. Show that for any non-zero rational number $x$, the set
$$\{f^n(x)\}_{n\geq 0} \cap \mathbb{Z}$$
is finite. For which $x$ is this set largest and what is its cardinality?
I found that we can assume without loss of generality that $x$ is a positive integer, but I can't seem to get any other ideas on how to approach the problem. Any help would be great!
 A: Suppose $z = a/b > 0$ is a reduced fraction (say $a,b>0$). Then $f(z) = \frac{a^2 + b^2}{ab} > 0$ is also a reduced fraction. From this your claim follows: Observe that $a/b$, being a reduced fraction, is an integer only if $b = 1$. So, iterating, the denominator will eventually be larger than $1$ and $f^n(z)$ will not be an integer. If $z = 1$, then $f(z) = 2$, $f^2(z) = 5/2$, and so on. This is the longest possible number (2) of integers possible.
A: Just for completeness, I'll do the reduction to the positive integer case. Those uninterested in the reduction, may skip to below the line.
We first note that the intersection set is discrete, because $\Bbb Z$ is. Second we note that the real-function $f(x)=x+x^{-1}$ has derivative
$$f'(x)=1-x^{-2}<1$$
hence the fixed points at $\pm 1 $ are attractors in neighborhoods around them, and by positive/negative symmetry, and the fact that an initial choice $z_0$ with $|z_0|<1$ produces immediately an iterate $z_1$ such that $|z_1|>1$ we may assume our initial choice is $M\ge c>1$, in fact it is easy to see that we can take $c=\sqrt{2}$.
In this case we can immediately assume our first choice is an integer, because if the sequence never hits an integer, certainly it has only finitely many answers. Together this reduces to $M\ge 2$ as an initial, integer choice. If you prefer a more direct proof of this, you can also just say if you were unlucky enough to pick $1$ first, then iterating the map gives you $2$, whatever floats your boat:  I tried to use as much of a dynamical systems approach as possible since that is the only tag on the question.

Now, since there is a prime $p|M$, we note that the $p$-adic valuation of $M$ is $|M|_p<1$.  But then $|f(M)|_p=|M+M^{-1}|_p$. By the strong triangle inequality, it must be that
$$|f(M)|_p=\max\{|M|_p, |M^{-1}|_p\}=|M^{-1}|_p>1.$$
But then $|f^k(f(M))|_p=|M^{-1}|_p>1$ again by the strong triangle inequality. In particular, the reduced fraction for $f^n(M)$ always has a $p$ dividing the denominator, hence it is not an integer.
This implies that--once we have an integer greater than $1$ in the orbit (or less than $-1$ by symmetry), it never hits another integer again. Hence the only way to have more than one integer in our sequence at all is if we have one not divisible by any prime, i.e. $\pm 1$. it is easily seen that $f(\pm 1)=\pm 2$, hence the largest orbits have size $2$ and are $\{\pm 1,\pm 2\}$.
