Proof for $\forall x\in \mathbb{Z}^+, \exists t \in \mathbb{Z}, 5 \nmid x \to ((x^2= 5t + 1) \vee (x^2 = 5t – 1))$ I am trying to write a proof for the following: If $x$ is a positive integer that is not divisible by $5$, then $x^2$ can be written either as $x^2 = 5t+1$ or $x^2 = 5t−1$ for some integer $t$. So far, I have managed to get that if $x$ is not divisible by $5$, then it is one of the following cases, where $n$ represents a positive integer: 
\begin{align*}
x & = 5n + 1\\
x & = 5n + 2\\
x & = 5n + 3\\
x & = 5n + 4
\end{align*}
I have tried substituting for $x$, but with two different variables $n$ and $t$ and everything, I'm not sure how I would prove they can be equal. Any help would be much appreciated. Thank you!

If $5 \not \mid x$, then 


*

*$x \equiv 1\mod 5$, 

*$x \equiv 2 \mod 5$, 

*$x \equiv 3 \mod 5$ or 

*$x \equiv 4 \mod 5$. 


Now $1^2 \equiv 4^2 \equiv 1\mod 5$ and $2^2 \equiv 3^2 \equiv -1\mod 5$ and therefore $x^2 \equiv 1 \mod 5$ or $x^2 \equiv -1 \mod 5$.
