Suppose $x^2+mx+n\in\mathbb{Z}$ is irreducible with root $\alpha$. Now if $m^2-4n=D_0^2D$ with $D$ squarefree, then $\mathbb{Q}[\alpha]=\mathbb{Q}[\sqrt{D}]$.

I don't get how one gets the relationship $m^2-4n=D_0^2D$ to the equality $\mathbb{Q}[\alpha]=\mathbb{Q}[\sqrt{D}]$. I write $\beta=\alpha+m/2$, so $\mathbb{Q}[\alpha]=\mathbb{Q}[\beta]$. Also $$\beta^2=\alpha^2+m\alpha+m^2/4\implies \beta^2+n-m^2/4=\alpha^2+m\alpha+n=0.$$ So $$m^2-4n=4\beta^2=D_0^2D$$ for some $D_0$ and $D$? Can I say $2\beta=D_0\sqrt{D}$, so $\mathbb{Q}[\beta]=\mathbb{Q}[\sqrt{D}]$, or is that oversimplifying the problem?

-

$$\alpha= \frac{-m\pm \sqrt{m^2-4n}}{2}.$$
So $\mathbb Q(\alpha)=\mathbb (\sqrt{m^2-4n})$ and $D$ is simply the square free part of $m^2-4n$. Then it's a simple exercise to show that if $m$ is an integer and $m^\prime$ is its square free part then $\mathbb Q(\sqrt{m})=\mathbb Q(\sqrt{m^\prime})$.