Why is it if we use 1 2 3 4 mod 5 and we take x^3 of these numbers, we come to: 1 3 2 4 (all numbers are different as you can see)? Why are they all different. Thanks
Explanation: $a^{\phi(p)} \equiv 1 \pmod{p}$ if $a$ and $p$ are relatively prime. You know that $\phi(5) = 5 - 1 = 4$, so if the exponent - say $k$ - is relatively prime to $4$, then the values of $x^k$ for $x \in {1, 2, 3, 4}$ will be all different. How can we conclude from $a^{\phi(p)} \equiv 1 \pmod{p}$ that all numbers are different?
We have by Euler's theorem that $a^{\phi(p)}\equiv1\pmod p$ if $(a,p)=1$,
so, if $bc\equiv1\bmod\phi(p)$, then $(a^b)^c=a^{bc}\equiv a^1=a\pmod p$,
so the map $a\mapsto a^b$ is invertible ($a\mapsto a^c)$ and therefore bijective.
For your particular example, take $p=5$, $\phi(p)=4$, $b=3$, and $c=3$.
Then the map $a\mapsto a^3$, which takes $1\mapsto1, 2\mapsto3, 3\mapsto2, $ and $4\mapsto4$ is its own inverse:
$$1\mapsto1\mapsto1, 2\mapsto3\mapsto2, 3\mapsto2\mapsto3, \text{ and } 4\mapsto4\mapsto4.$$
If the map were not one-to-one, it could not be inverted.