For integral domains $A,F$ such that $A \subseteq F$, we say that $a \in F$ is integral over $A$ if there exist a monic polynomial $f(x)$ in $A[x]$ such that $f(a) = 0$.
I have the following problem:
For simplicity let $A = \mathbb{Z}[\sqrt 5]$, $F = \mathbb{Q}(i, \sqrt 5)$ and $B = \{ \,a+ib \, \vert \, a,b \in \mathbb{Z}\left[ \frac{1 + \sqrt 5}{2}\right]\}$. I need to show that the integral closure of $A$ in $F$ (we denote it by $A^F$) is $B$.
It is straightforward to show that $B \subseteq A^F$ i.e. any $a+ib \in B$ satisfies the equation $x^2 - 2ax + a^2 +b^2 = 0$ and $2a, a^2+b^2 \in A$.
Now let $\alpha =a +ib \in A^F$ and we need to show that $\alpha \in B$. Since $\alpha \in A^F$ there exist a monic polynomial in $A$ such that $f(\alpha) = 0$. Also $\alpha$ satisfies the equation $g(x) = x^2 - 2ax + a^2 +b^2 = 0$. Now we can use division algorithm , so there exist $q(x), r(x) \in F[x]$ such that $f(x) = q(x)g(x) +r(x)$ where $r(x) $ is almost linear polynomial. Since $f(\alpha) = g(\alpha) =0 $ we get $r(\alpha) = 0$. Now it is easy to see that $r(\alpha) =0 \implies r(x) = 0$. So we have $$f(x) = g(x)q(x).$$
From the above equation it follows that $f(x)$ is reducible in $F[x]$. I understand that if I can show that $g(x) \in A[x]$ then it follows that $2a, a^2+b^2 \in A$ and then it is possible to show that $a+ib \in B$. How can I proceed further?