Example 8 Find the integer $k$ such that the quadratic equation
$$
k x^{2}+(k+1) x+(k-1)=0
$$

has integer roots.
(1993, 5th Ancestor's Cup Junior Mathematics Contest)
$$
\begin{array}{l}
x_{1}+x_{2}=-\frac{k+1}{k}=-1-\frac{1}{k}, \\
x_{1} x_{2}=\frac{k-1}{k}=1-\frac{1}{k} .
\end{array}
$$
( $k$ is a real number, at this point we cannot conclude $k=1,-1$ )
If $x_{1} x_{2}-x_{1}-x_{2}=2$,
then $\left(x_{1}-1\right)\left(x_{2}-1\right)=3$,
thus $\left\{\begin{array}{l}x_{1}-1=1, \\ x_{2}-1=3\end{array}\right.$ or $\left\{\begin{array}{l}x_{1}-1=-3, \\ x_{2}-1=-1 .\end{array}\right.$
Solving, $x_{1}=2, x_{2}=4$ or $x_{1}=-2, x_{2}=0$.
Therefore, $k_{1}=-\frac{1}{7}$ or $k_{2}=1$.