Hello I am wondering if my approach is on the right track or not.
I want to show that if $m \in \mathbb{Z}$ and $m \neq 0$ is a solution to the equation $x^2+ax+b=0$ where $a, b$ also are integers then $m|b.$
My first approach was that by applying the quadratic formula, we obtain $$x_1=\frac{-a+\sqrt{a^2-4b}}{2}$$ and $$x_2=\frac{-a-\sqrt{a^2-4b}}{2}$$
but I wasnt sure what to do from there,
so I tried saying that x^2+ax=-b
but we dont want to consider cases that x is zero, so it have to solve above.
If $m$ was an integer that certainly $m^2$ is an integer and a is an integer so a(x) is an integer, and their sum to is an integer, so that may show that $m^2+am|-b$, and hence $-m^2-am|b$ and now I must continue. Is this correct? Thanks
In your solution, you are assuming that $m^2+ma\neq0,$ which is true only if $b\neq0.$ Also, is it necessary to show that $m^2+ma\mid b$ and $-m^2-ma\mid b$?.
Here is something you can do: since $m$ is a solution of the equation then $$m^2+am+b=0\iff m(m+a)=-b.$$ Now, you know that $m$ and $a$ are both integers and so $m+a$ is an integer and hence $m\mid -b,$ which implies that $m\mid b.$
For a generalization see this.