Splitting ideals generated by prime numbers in $\mathbb{Z}[\sqrt{-5}]$ Let $p\in \mathbb{Z}$ a prime such that $\left(\frac{-5}{p}\right)=1$. Then as
$$\mathbb Z[\sqrt{-5}]/(p)\cong \mathbb{Z}[X]/(X^2+5)/(p)\cong \mathbb{F}_p[X]/(X^2+5),$$
we have some $a$ such that $(X-a)(X+a)=X^2+5$ in $\mathbb{F}_p[X]$. Then by Chinese remainder theorem,
$$\mathbb Z[\sqrt{-5}]/(p)\cong \mathbb{F}_p[X]/(X+a)\times\mathbb{F}_p[X]/(X-a)$$
How does this imply $(p)=(p, \sqrt{-5}+a)(p, \sqrt{-5}-a)$? This might be a trivial question, but I am really confused. I tried to find similar questions, but I failed to understand the rationale behind this immediate inference. I couldn't see why the isomorphic relation suggests that $(p)$ is a product of two ideals.
 A: Disclaimer: This argument might be somewhat overcomplicated (and/or wrong), but I've written it now so I might as well post. I think sometimes the details of this sort of thing are glossed over, so it's possible this is what the author intended. It is also possible that I'm just an idiot.
Answer: If $R$ is a ring and $P$ is an ideal, then $P$ is prime if and only if $R/P$ is an integral domain. Therefore $(p)$ is not prime, so it must factor as a product of other prime ideals. The norm of $(p)$ is $p^2$, so it has two prime factors $\mathfrak{a}$ and $\mathfrak{b}$ of norm $p$.
Let $A, B$ be the images of $\mathfrak{a}$ and $\mathfrak{b}$ under the natural isomorphism
$$\mathbb{Z}[\sqrt{-5}] \to \mathbb{Z}[x]/(x^2+5).$$
Note that $p\in \mathfrak{a},\mathfrak{b}$ so $p \in A,B$. Therefore we may reduce mod $p$ to obtain ideals $\bar{A}, \bar{B}$ of $\mathbb{F}_p[x]/(x^2+5)$ with $\bar{A}\bar{B} = 0$. These ideals lift to ideals $\tilde{A},\tilde{B}$ of $\mathbb{F}_p[x]$ with $\tilde{A}\tilde{B} = (x^2+5)$, so by unique factorisation in $\mathbb{F}_p[x]$, we have (without loss of generality) $\tilde{A} = (x+\sqrt{-5}),\tilde{B} = (x-\sqrt{-5})$, where we take the square root of $-5$ in $\mathbb{F}_p$.
Therefore $\bar{A} = (x+\sqrt{-5})$ and $\bar{B} = (x-\sqrt{-5})$ modulo the ideal $(x^2+5)$. Lifting to $\mathbb{Z}[x]/(x^2+5)$, we see that $A = (p, x+\sqrt{-5})$ and $B=(p, x-\sqrt{-5})$, and therefore we are done, because your $a$ is the same thing as my $\sqrt{-5}$.
