Why are the following statements true?
$\left(\frac{5}{p}\right)=\left(\frac{p}{5}\right)=1\Rightarrow p\equiv 1\pmod{5}$ or $p\equiv 4\pmod{5}$
$\left(\frac{5}{p}\right)=\left(\frac{p}{5}\right)=-1\Rightarrow p\equiv 2\pmod{5}$ or $p\equiv 3\pmod{5}$
Use the above to conclude that:
$\left(\frac{5}{p}\right)=|2(p\mod{5})-5|-2$ where $p\pmod{5}\in [1,2,3,4]$
By Quadratic Reciprocity $\left(\frac{5}{p}\right)=\left(\frac{p}{5}\right)$, becauce $5\equiv 1\pmod{4}$.
Then $\left(\frac{p}{5}\right)=1\iff p\equiv \{1,4\}\pmod{5}$ because $1^2\equiv\color{#AAA} 1$, $2^2\equiv \color{#AAA}4$, $3^2\equiv \color{#AAA}4$, $4^2\equiv \color{#AAA}1$$\pmod{5}$.
Similarly $\left(\frac{p}{5}\right)=-1\iff p\equiv \{2,3\}\pmod{5}$.
For the other question, check four cases $p\equiv 1,2,3,4\pmod{5}$ and notice it's true for all the cases.