How can I find all natural numbers $a$ and $b$ so that the roots of the equation $x^2-abx+a+b$ are integer? ($x$ is a variable)
The first idea that came into my mind was to find the solutions of the equation. They are: $x = \frac{ab - \sqrt{a^2 b^2 - 4a - 4b}}{2}; x = \frac{ab + \sqrt{a^2 b^2 - 4a - 4b}}{2}$
What is possible to be done next?
Suppose the roots are $c$ and $d$. Then $$(x-c)(x-d)=x^2-abx+a+b$$ gives $c+d=ab, a+b=cd$. Now we normally expect that $a+b < ab,$ s0 we have $$a+b<ab=c+d<cd,$$ contradicting $a+b=cd.$
I leave it to you to find the cases where $a+b < ab$ is violated and which ones give answers to the problem.
Your way of starting out was a fine idea, but it just doesn't happen to pan out, so far as I can see.
EDIT I wrote the above before the clarification about integers and naturals. I had assumed that $c$ and $d$ were naturals also. However, that's easy to deduce from $c+d=ab, a+b=cd$.