TITLE: Why is $\sqrt{2}$ not in the ring of integers of $\mathbb{Q}$?
QUESTION [5 upvotes]: Sorry if this is too obvious but I can't see what I'm missing. If an element $b\in B$ is the root of a polynomial $f\in A[X]$, then $b$ is integral over $B$.
$\sqrt{2}$ is a root of $f(X) = X^2 -2$, so why is the integral closure of $\mathbb{Z}$ in $\mathbb{Q}$ equal to $\mathbb{Z}$? I know I must be misreading a definition but I can't see where, if anyone could point out what I'm missing that would be great.

REPLY [6 votes]: By definition the ring of integers of a field is a subset of the field. $\sqrt 2$ satisfies an integral equation over $\Bbb Q$, sure, but it's not in the field. In fact, you can see from this that integral elements of a field are exactly those that satisfy integral, linear polynomials over the field's integer ring. (Since linear iff the constant term is in the field already).
Your question and title, in particular, don't match: integral closure and elements of a field which are integral are not the same thing, that's a question only for things which you can talk about integrality for, since while $\Bbb Z$ is the ring of integers for $\Bbb Q$ it is not the integral closure of $\Bbb Q$.