A simple explanation with Lagrange's theorem:
You have to show the map $x\mapsto x^3$ is injective in the multiplicative group $(\mathbf Z/5\mathbf Z)^\times$. As it is a group homomorphism because the group is commutative, it amounts to showing its kernel is $\{1\}$.
Consider $x\in\{1,2,3,4\}$ such that $x^3=1$. This implies the order of $x$ is a divisor of $3$. But as it is an element of the group $(\mathbf Z/5\mathbf Z)^\times$, of order $4$, it is also, by Lagrange, a divisor of $4$, and $\gcd(3,4)=1$. Therefore, necessarily, we have $x=1$.
Some details:
Denote, for any $x\in(\mathbf Z/5\mathbf Z)^\times$, $o(x)$ (the order of $x$) the least positive integer $k$ such that $x^k\equiv 1\mod 5$. It is easy to show that if $x^\ell\equiv 1\mod 5$, then $\ell$ is a multiple of $o(x)$.
Now suppose $x^3\equiv y^3\mod 5$. If we denote $y^{-1}$ the inverse of $y\bmod 5$, this implies that $x^3(y^3)^{-1}=\bigl(xy^{-1}\bigr)^3\equiv 1\mod 5$. By the property mentioned in the above §, $3$ is a multiple of $o(xy^{-1})$. Since $3$ is prime, this order is therefore either $1$ or $3$.
However, one can show that this order is also a divisor or $\#(\mathbf Z/5\mathbf Z)^\times$, which is $4$. As $3\not\mid 4$, the only solution is $\;o(xy^{-1})=1$, which means, by definition, that $xy^{-1}=1$, whence, multiplying both sides by $y$, $x=y$.