<s>[INST] If $p$ is an odd prime (different than $5$) prove that $10 \mid p^{2}-1$ or $10 \mid p^{2}+1$ I was reading some properties on prime numbers in a book and I’ve found this problem.
Using Modular Arithmetic isn’t allowed
Using the division algorithm I have found:
$p \in \{5m+1, 5m+2, 5m+3, 5m+4\}$
I’ve tried to plug those values of $p$ to :$\frac{p^{2}\pm1}{10}$, but I didn’t get an integer.
Thank you for your help
 [/INST] Why on earth would modular arithmetic not be allowed.  As I am of the theory all arithmetic is modular arithmetic that may be hard.
But as $p$ is an odd prime $p^2 -1$ and $p^2 +1$ are both even and $2|p^2 \pm 1$ so it is sufficient to show that $5|p^2 -1$ or $5|p^2 + 1$.  .... Oh, wait, that was modular arithmetic!  Well, too bad.
Now $p$ is odd so $p=2k-1$ for some integer $k$ so $p^2\pm 1 = 4k^2 - 4k+1 \pm 1 =\begin{cases}4k^2 - 4k = &5k^2 - 5k -k^2 + k = &5(k^2-k) -k(k-1)\\4k^2+4k+2 = &5k^2 - 5k - k^2 + k +2=&5(k^2-k) -(k+1)(k-2)\end{cases}$.
Now $k-2,k-1,k,k+1,k+2$ are five consecutive numbers so one of them is divisible by $5$.  (Oh wait... that was modular arithmetic!... Oh, well.)  If the one divisible by $5$ is $k$ or $k-1$ then $p^2 -1 = 4k^2 -4k = 5(k^2-k) -k(k-1)$ is divisible by $5$
If $k+1$ or $k-2$ is divisible by $5$ then $p^2+1 = 4k^2 -4k + 2 = 5(k^2-k) -(k+1)(k-2)$ is divisible by $5$.
And if $k+2$ is divisible by $5$, then there is an integer $m$ so that $5m = k+2$ so $p = 2k -1=2(5m-2)-1=10m-5 = 5(2m-1)$.  But that means $p$ is not a prime other than $5$.  So this is impossible.  $k+2$ is not divisible by $5$ and one of the other four cases must be true.
.....
But that used modular arithmetic.
</s>