\(\displaystyle n=1\!\!\!\pmod 4\Longrightarrow n\) is odd, so it must be \(\displaystyle n=1,3,5\,\,or\,\,7\!\!\!\pmod 8\), but \(\displaystyle n=3\!\!\!\pmod 8\Longrightarrow n=3\!\!\!\pmod 4\)...with 7 is similar.

\(\displaystyle n=1\!\!\!\pmod 4\Longrightarrow n\) is odd, so it must be \(\displaystyle n=1,3,5\,\,or\,\,7\!\!\!\pmod 8\), but \(\displaystyle n=3\!\!\!\pmod 8\Longrightarrow n=3\!\!\!\pmod 4\)...with 7 is similar.

By the definition of congruence, \(\displaystyle n\equiv{1}\ (\text{mod }4)\) means 4 divides n-1. Since \(\displaystyle \frac{n-1}{4}\) is an integer, it must be odd or even. So \(\displaystyle \frac{n-1}{4}=2m\text{ or }2m+1\), where m is an integer. Solving both for m gives \(\displaystyle m=\frac{n-1}{8}\text{ or }\frac{n-5}{8}\) so \(\displaystyle n\equiv{1}\text{ or }5\ (\text{mod }8)\). And, of course, you can reverse the argument.