Let $x$ be a non-real complex number. And we know that $x,\overline{x}$ are solutions to $z^2+az+b=0$. We want to show that $a$ and $b$ are real numbers.
We get $(z-\overline{x})(z-x)=0$ and therefore $z^2-z\overline{x}-zx+x\overline{x}=0$. We thus have that $a=-\overline{x}-x$ and $b=x\overline{x}$. We now conclude that $a,b\in \mathbb{R}$.
The problem is that I found another solution that contradicts the first solution:
We write $x=r+it$ and $a=c+id,b=f+ih$. We know that $t\neq 0$. We also have that $$(r+it)^2+(r+it)(c+id)+f+ih=0$$ and therefore $$r^2-t^2+rc-td+f=0$$. We also know that $$(r-it)^2+(r-it)(c+id)+f+ih=0$$ and therefore $$r^2+t^2+rc+td+f=0$$. We now have $$r^2-t^2+rc-td+f=r^2+t^2+rc+td+f$$ and therefore $$-t^2-td=t^2+td$$ and therefore $-t-d=t+d$ and we get $-2t=2d$ and therefore $-t=d$ and finally $d\neq 0$. We found that $a$ is not a real number.
Where did I go wrong?
Actually, it results that
$(r-it)^2=r^2\color{red}{-t^2}-2irt\;,$
but you wrote that
$\Re\left[(r-it)^2\right]=r^2+t^2\,,\,$ so you have to correct it.
If you correct it, you will get that $\;td=0\,,$
hence $\,d=0\,,\,$ that is $\,a\in\Bbb R\,.$