2. Let $m$ be a non-zero integer, and the quadratic equation in $x$, $m x^{2}-(m-1) x+1=0$, has rational roots. Find the value of $m$.


(Given: Let $\Delta=(m-1)^{2}-4 m=n^{2}, n$ be a non-negative integer, then $(m-3)^{2}-n^{2}=8$, i.e., $(m-3-n)(m-3+n)=$ 8. Following Example 2, we get $\left\{\begin{array}{l}m=6, \\ n=1\end{array}\right.$ or $\left\{\begin{array}{l}m=0, \\ n=1\end{array}\right.$ (discard). Therefore, $m=6$, and the two roots of the equation are $\frac{1}{2}$ and $\frac{1}{3}$.)