Hint $ $ The set $I$ of $\,f\in\Bbb Q[x]\,$ with root $\,w = a+\sqrt b\,$ is an ideal, i.e. $I$ is closed under subtraction & multiplication by any $\,g\in \Bbb Q[x].\,$ Thus by the Euclidean algorithm $\,I = (g)\,$ is principal, generated by any min degree $\,g\in I\,$ (else $\,0\ne f\ {\rm mod}\ g = f - q\:\! g \in I\,$ & has degree $< \deg g)$.
By $\,\sqrt b\not\in\Bbb Q,\,$ a min degree $\,g \in I\,$ has degree $\,2,\,$ e.g. $\,g = (x-w)(x-\bar w),$ $\ \bar w = a-\sqrt b = $ conjugate of $\,w.\,$ Hence $\ f(w) = 0\iff f\in (g)\iff g\mid f\iff w,\bar 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 (here size = degree, and the generator $\,g\,$ is called a "minimal polynomial" for $\,w)$.