On finding an integral basis of $\mathbb{Q}[\sqrt{5}]$ On section 2.4 of the book Algebraic Number Theory (by Stewart and Tall), there is an example showing how to derive an integral basis to the number field $K = \mathbb{Q}[\sqrt{5}]$.
It is said that any element $y$ of $K$ is of the form $p + q\sqrt{5}$, with $p$ and $q$ in $ \mathbb{Q}$ and have minimal polynomial 
$$(x - p - q\sqrt{5})(x - p + q\sqrt{5}) = x^2 -2px + (p^2 - 5q^2)$$
Also, such $y$ belongs to $\mathcal{O}_K$ if $2p \in \mathbb{Z}$ and $(p^2 - 5q^2) \in \mathbb{Z}$. Thus, $p = \frac{1}{2} \alpha$, with $\alpha \in \mathbb{Z}$.
Until here, everything is fine. But then, it is said that


*

*If $\alpha$ is even, $p^2 \in \mathbb{Z}$ and then $q \in \mathbb{Z}$.

*If $\alpha$ is odd, then $q = \frac{1}{2}\beta$ for some $\beta \in \mathbb{Z}$.


And finally, the conclusion is 

From this it follows that $\mathcal{O}_K = \mathbb{Z}[\frac{1}{2} + \frac{1}{2}\sqrt{5}]$ and an integral basis is $\{1, \frac{1}{2} + \frac{1}{2}\sqrt{5} \}$

But I don't understand how conditions 1. and 2. imply in that conclusion. I think that condition 1. would imply in $y$ to be of the form $\frac{1}{2}\alpha + \gamma\sqrt{5}$ for some $\gamma \in \mathbb{Z}$ and that condition 2. would imply in $y$ to be of the form $\gamma + \frac{1}{2}\beta\sqrt{5}$...
Could someone here clarify that point of the example?
 A: If $\alpha$ is even, then $p=\frac{1}{2}\alpha$ is an integer, so $p^2$ is an integer, and therefore in order for $p^2-5q^2$ to be an integer (as we know it must be), we must have that $5q^2$ is an integer, and hence $q$ must be an integer.
If $\alpha$ is odd, then $\alpha^2$ is odd, and  $p^2=\frac{\alpha^2}{4}$, and therefore in order for $p^2-5q^2$ to be an integer (as we know it must be), we must have
$$p^2+(\text{an integer})=\frac{(\text{odd})}{4}=\frac{5a^2}{b^2}=5q^2$$
where $q=\frac{a}{b}$ is in lowest terms. Therefore $a$ is odd and $b=2$.

Now you have shown that any $p+q\sqrt{5}$ in $\mathcal{O}_K$ either has $p,q\in\mathbb{Z}$, or $p=\frac{a}{2}$ and $q=\frac{b}{2}$ for odd $a,b\in\mathbb{Z}$. 
In other words, you have shown that
$$\mathcal{O}_K=\{\tfrac{a}{2}+\tfrac{b}{2}\sqrt{5}:a,b\in\mathbb{Z},\; a\equiv b\bmod 2\}$$
You can write any such element as $\frac{a-b}{2}(1)+b(\frac{1}{2}+\frac{1}{2}\sqrt{5})$ to demonstrate that $\{1,\frac{1}{2}+\frac{1}{2}\sqrt{5}\}$ is an integral basis for $\mathcal{O}_K$.
