Hint $ $ The set $I$ of $\,f\in\Bbb Q[x]\,$ with root $\,w = a+\sqrt b\,$ is an ideal, i.e. is closed under subtraction & multiplication by any $\,g\in \Bbb Q[x].\,$ So by the Euclidean algorithm $\,I = (g)$ is principal, generated by any element of minimal degree (else $\,0\ne f\ {\rm mod}\ g = f - q\:\! g \in I\,$ and has degree smaller than $\,g).$
By $\,\sqrt b\not\in\Bbb Q,\,$ a min degree $\,g \in I\,$ has degree $\,2,\,$ e.g. $\,g = (x-w)(x-w'),$ $\, w' = a-\sqrt b = $ conjugate of $\,w.\,$ Hence $\ f(w) = 0\iff f\in (g)\iff g\mid f\iff w,w'\,$ are roots of $\,f.$
Remark $\ $ The same idea works generally to show that ideals in Euclidean domains (i.e. domains enjoying division with "smaller" remainder) are principal, generated by any element of minimal Euclidean size (above the size is the polynomial degree)