If $p\equiv 1,9 \pmod{20}$ is a prime number, then there exist $a,b\in\mathbb{Z}$ such that $p=a^{2}+5b^{2}$. I have to prove that if $p\equiv 1,9 \pmod{20}$ is a prime number then there exist $a,b\in\mathbb{Z}$ such that $p=a^{2}+5b^{2}$.
I consider the quadratic field $\mathbb{Q}(\sqrt{-5})$, with ring of integers $A=\mathbb{Z}[\sqrt{-5}]$. It is easy to check that $\left (- \dfrac{5}{p} \right)=1$ if $p\equiv 1,9 \pmod {20}$. According to this, $t^{2}+5$ has two different roots in $\mathbb{F}_{p}$. In consequence, $pA=P_{1}P_{2}$ for certain prime ideals $P_{1}, P_{2}$ with norm $p$. A is not a PID, but if I prove that $P_{1}$ or $P_{2}$ are principal, then I had there exist $\gamma=a+b\sqrt{-5}\in A$ such that:
$p=N(P_{i})=N(\gamma A)=|N_{\mathbb{Q}(\sqrt{-5})|\mathbb{Q}}(\gamma)|=a^{2}+5b^{2}$,
and I would have finished. The problem is that I do not know how to prove this. If there is an easier way, please, let me know.
 A: I'm not sure which level to write this at. Here is a completely elementary proof:
As you say, if $p \equiv 1$, $3$, $7$ or $9 \bmod 20$, then $\left( \frac{-5}{p} \right) = 1$. Let $p$ be in one of these residue classes and let $a$ be a square root of $-5$ modulo $p$. Let $\Lambda \subset \mathbb{Z}^2$ be the lattice of pairs $(x,y)$ such that $x \equiv ay \bmod p$. For any $(x,y) \in \Lambda$, we have $x^2+5 y^2 \equiv (ay)^2 + 5 y^2 \equiv (-5+5) y^2 \equiv 0 \bmod p$. Since $\Lambda$ has index $p$ in $\mathbb{Z}^2$, the fundamental domain of $\Lambda$ has area $p$. The ellipse $\{ (x,y) : x^2+5y^2 < N \}$ has area $\pi N/\sqrt{5}$. 
Therefore, taking $N = (4\sqrt{5}/\pi) p \approx 2.85 p$, Minkowski's theorem shows that $\Lambda$ contains a point $(x,y)$ with $0 < x^2+5y^2 < 2.85 p$. Since $x^2+5y^2 \equiv 0 \bmod p$, we deduce that $x^2+5y^2 = p$ or $2p$.
So far, the proof works for all four residue classes $1, 3, 7, 9 \bmod 20$. Now note that, if $p \equiv 1$ or $9 \bmod 20$, the equation $x^2+5y^2 = 2 p$ is impossible modulo $8$.

You can tweak this proof to be more or less sophisticated, as you please.
More If $\left( \frac{-5}{p} \right)=1$ then the ideal $p$ splits as $\mathfrak{p} \bar{\mathfrak{p}}$ in $\mathbb{Z}[\sqrt{-5}]$. From the Minkowski bound, $\mathfrak{p}$ must have the same ideal class as an ideal of norm $< 4 \sqrt{5}/\pi \approx 2.85$, so either $\mathfrak{p}$ is principal or else $\mathfrak{p} \sim \langle 2, 1+\sqrt{5} \rangle$, in which case $\mathfrak{p} \cdot \langle 2, 1+\sqrt{5} \rangle$ is principal. In the former case, we have a solution to $x^2+5y^2=p$; in the latter case, we have a solution to $x^2+5y^2=2p$ which is impossible modulo $8$. It's not a surprise that the same numbers are showing up -- the above proof is simply this one without mentioning ideal classes.
Less If you don't want to mention Minkowski's theorem, you can mimic the pigeonhole proof here that any prime which is $1 \bmod 4$ is the sum of two squares. Consider the numbers $x-ay$ for $0 \leq x < \sqrt[4]{5} \sqrt{p}$ and $0 \leq y < \sqrt{p}/\sqrt[4]{5}$ and proceed as in the link. The inequality isn't as good as you get with Minkowski: You conclude that you can solve $x^2+5y^2 \equiv 0 \bmod p$ with $0 < x^2+5y^2 < 2 \sqrt{5} p \approx 4.46 p$. 
But that's good enough, you just get a few more cases. If $x^2+5y^2=p$, you win. If $x^2+5y^2=2p$, you get a contradiction modulo $8$, if $x^2+5y^2 = 3p$, you get a contradiction modulo $4$. If $x^2+5y^2=4p$ then looking modulo $4$ shows that $x$ and $y$ are even, so $(x/2)^2+5(y/2)^2=p$.
