II. (Full marks 25 points) Find the real number $k$, such that the roots of the equation $k x^{2}+(k+1) x+(k-1)=0$ are all integers.

Translate the above text into English, please retain the original text's line breaks and format, and output the translation result directly.
When $k=0$, the original equation becomes $x-1=0 . x=1$ which satisfies the condition.

When $k \neq 0$, let the two integer roots of the original equation be $\alpha$ and $\beta$, and assume $\alpha \geqslant \beta$. By Vieta's formulas, we get
$$
\begin{array}{l}
\alpha+\beta=-\frac{k+1}{k}=-1-\frac{1}{k}, \\
\alpha \beta=\frac{k-1}{k}=1-\frac{1}{k} .
\end{array}
$$
Subtracting (1) from (2) yields
$$
\alpha \beta-\alpha-\beta=2 \text {, }
$$

which simplifies to $(\alpha-1)(\beta-1)=3$.
Since $\alpha$ and $\beta$ are integers, $\alpha-1$ and $\beta-1$ are also integers.
Solving, we get $\left\{\begin{array}{l}\alpha=4, \\ \beta=2\end{array}\right.$ or $\left\{\begin{array}{l}\alpha=0, \\ \beta=-2 .\end{array}\right.$
$$
\therefore \alpha+\beta=6 \text { or } \alpha+\beta=-2 \text {. }
$$

Substituting these into (1), we get $k=-\frac{1}{7}$ or $k=1$.
$\therefore$ When $k=0,1,-\frac{1}{7}$, the roots of the original equation are all integers.