<s>[INST] Find all integer values for $m$ such that $x_1,x_2\in\mathbb{Z}$ We have $(m+1)x^2-(2m+1)x-2m=0$ where $m\in\mathbb{R}\backslash\left\{-1\right\}$. We need to find all integer values for $m$ such that both roots of the equation are integers.
Here is all my steps:


*

*$x_{1,2}=\frac{(2m+1)\pm\sqrt{12m^2+12m+1}}{2(m+1)}\in\mathbb{Z}$
$\Rightarrow 2(m+1)\:|\:(2m+1)\pm\sqrt{12m^2+12m+1}$
$\Rightarrow 2(2m+2)+1\pm\sqrt{12(2m+2)^2+12(2m+2)+1}=0$

*$x_1=2(2m+2)+1+\sqrt{12(2m+2)^2+12(2m+2)+1}=0$
$\Rightarrow \sqrt{12(2m+2)^2+12(2m+2)+1}=-4m-5$
$\Rightarrow 12(2m+2)^2+12(2m+2)+1=(-4m-5)^2$
$\Rightarrow 12(4m^2+8m+4)+24m+25=16m^2-40m+25$
$\Rightarrow 48m^2+96m+48+24m+25=16m^2-40m+25$
$\Rightarrow 32m^2+160m+48=0$|:16
$\Rightarrow 2m^2+10m+3=0$ but $\sqrt{\Delta}\notin\mathbb{N}$
Now we have to verify for $x_2$ like above:


*

*$x_2=48m^2+96m+48+24m+25=16m^2+40m+25$


$\Rightarrow 32m^2+80m+48=0|:16$
$\Rightarrow 2m^2+5m+3=0 \Rightarrow \sqrt{\Delta}=1$
$\Rightarrow m_1=-1\in\mathbb{Z}, m_2\notin\mathbb{Z}$

But as the author says $m\in\mathbb{R}\backslash\left\{-1\right\}$

 [/INST] I'm sorry, but I find as the only answers $m=0$ or $m=-2$ or $m=-1$ (though in the latter case there are not two solutions).
To see this, note that if $m=-1$, it' not a quadratic equation, and the  solution is $x=-2$.
If $m\neq -1$, let $x_1, x_2$ be the roots; use Vieta's relations:
$$x_1x_2=-\frac{2m}{m+1},\quad x_1+x_2=\frac{2m+1}{m+1}.$$
If $m, x_1,x_2$ are integers, this implies $m+1$ divides both $2m$ and $2m+1$, hence it divides $1$, whence $m+1=\pm 1\iff m=0,-2$.
For $m=0$, the equation is $\;x^2-x=0$, which has roots $0,1$.
For $m=-2$, the equation is $\;-x^2+3x+4=0$, which has roots $-1,4$.
</s>