I have tried to solve the question above by taking $2$ cases.
CASE: $1$
Let the 2 roots of the equation be $\alpha$ and $\beta$.
In this case I took $\alpha = \beta$ and I got 2 solutions for $(a,b)$.
CASE: $2$
In this case I took $\alpha$ is not equal to $\beta$.
But after this I am not able to solve it .

Hint:
We must have: $$x^2+ax+b=(x-\alpha)(x-\alpha^2+2)$$
Working out the RHS and comparing it with LHS we find expressions for $a$ and $b$ in $\alpha$.