<s>[INST] Find all integers n such that $\;\frac{n^2-9}{n^2-5n+4}$ is an integer. 
Find all integers such that $\;\dfrac{n^2-9}{n^2-5n+4}\;$ is an integer.

I am really struggling to figure this out. I can tell that -3,3, and 5 are solutions but I don't know how to show that these are the only solutions or if they even are the only solutions.
 [/INST] Longer, but using only divisibility considerations:
This factors as $\frac{(n-3)(n+3)}{(n-4)(n-1)}$. Note $n$ cannot be $1$ or $4$. 
So $|n-1|\geq1$, and if $p$ is a prime dividing $n-1$, then $p$ has to divide $n-3$ or $n+3$. So mod $p$, either $n\equiv1\equiv3$ or $n\equiv1\equiv-3$. Either way, $p$ must be $2$, and $n-1=\pm2^k$ for some $k\geq0$. 
$$\frac{(\pm2^k-2)(\pm2^k+4)}{(\pm2^k-3)(\pm2^k)}$$
Now we see $k$ can't be $4$ or more, or else the denominator is divisible by $16$ and the numerator is not. So there are two ($\pm$) cases for each of $k=0,1,2,3$:
$$\begin{align}
\frac{(\pm1-2)(\pm1+4)}{(\pm1-3)(\pm1)}&&\frac{(\pm2-2)(\pm2+4)}{(\pm2-3)(\pm2)}&&\frac{(\pm4-2)(\pm4+4)}{(\pm4-3)(\pm4)}&&\frac{(\pm8-2)(\pm8+4)}{(\pm8-3)(\pm8)}
\end{align}$$
There are eight options to check. 
$$\begin{align}
\frac{5}{2}&&0&&4&&\frac{9}{5}\\
\frac{-9}{4}&&\frac{4}{-5}&&0&&\frac{5}{11}
\end{align}$$
The integers happened for $$n=2^1+1=3$$ $$n=2^2+1=5$$  $$n=-2^2+1=-3$$
</s>