I was reading on a website that in order to find a multiplicative inverse you just have to multiply the number you are given by $1\ldots n-1$ where $n$ is the modulus and you guaranteed to find the multiplicative inverse.
For example if you have, $5x \equiv 1 (mod 3)$, then all you have to do is multiply $5$ by $0$, $1$, and $2$. How do I know that $5 \cdot 1$ and $5 \cdot 2$ won't both generate $2$ as their equivalence class instead of $1$ and $2$ being unique equivalence classes?