Example 1 Find all rational numbers $r$ such that the equation
$$
r x^{2}+(r+1) x+(r-1)=0
$$

has all solutions as integers.
When $r=0$, the equation is $x-1=0$, and its root $x=1$ is an integer.
When $r \neq 0$, equation (1) is a quadratic equation in $x$. If it has integer roots $x_{1}, x_{2}$ (assuming $x_{1} \geqslant x_{2}$), by Vieta's formulas, we get
$$
\left\{\begin{array}{l}
x_{1}+x_{2}=-1-\frac{1}{r}, \\
x_{1} x_{2}=1-\frac{1}{r},
\end{array}\right.
$$

Eliminating $r$ from these, we get $x_{1} x_{2}-x_{1}-x_{2}=2$, which simplifies to $\left(x_{1}-1\right)\left(x_{2}-1\right)=3$.
This gives us
$$
\left\{\begin{array}{l}
x_{1}-1=3, \\
x_{2}-1=1,
\end{array} \quad \left\{\begin{array}{l}
x_{1}-1=-1, \\
x_{2}-1=-3,
\end{array}\right.\right.
$$

Solving these, we get $x_{1}=4, x_{2}=2$ or $x_{1}=0, x_{2}=-2$. Thus, we find $r=-\frac{1}{7}$ or 1.
In summary, when $r=0$ or $\frac{1}{7}$ or 1, all roots of equation (1) are integers.