How do you guarantee multiplicative cycles generated by a number that's relatively prime to the module have same length? I'll just upload a Brilliant page first. Check this out please.










Now, what I don't understand are three parts.

*

*I get it, when they say it's important to have a multiplicative inverse there. You have to have a multiplicative inverse to return to the 1. But how does that guarantee some cycle would come back to where it started which is not 1? Like, if you start at 13 or whatever and keep multiplying a number, and how do you be sure about the cycle would come back to 13 just because the multiplying number has the inverse to the module?


*Again, they said that this whole process is related to the multiplicative inverse, and that's why it's true that the cycles that have numbers relatively prime to the module have same length each other. This is the most confusing one to me. Firstly, I don't even get why they furtively change the subject from "the number being multiplied is relatively prime to the module" to "the numbers in the cycles are relatively prime to the module". Furthermore how can you confidently say that multiplying the integers of one cycle by some fixed integer will give you a unique integer from the other cycle?


*They say all that that's all about being relatively prime to the module or not. But as you can see in the picture below, I think there's more to it than that. 
Look, the red cycle has numbers that are not relatively prime to the module, 14, and it still has the same length and the same figure with the black one.
 A: The integers which are coprime to $n$ form a group under multiplication modulo $n$. Denote this group by $G$.
Let $H$ be the group of powers of $a$ modulo $n$ for some $a$ coprime to $n$.
The multiplicative cycles in $G$ are the cosets of $H$ in $G$.
Let $g_1H$, $g_2H$ be two such cosets. These two cosets must contain the same number of elements because $f(x)=g_2g_1^{-1}x$ is a bijection from $g_1H$ to $g_2H$.

Your example in #3 can be generalized as follows.
Let $a$ be coprime to $n$, $q$ be a divisor of $n$ and $a$ be coprime to $q$. Then the cycle $a^k$ and the cycle $qa^k$ are of the same length; $f(x)=qx$ is a bijection because $qa^k$ will always be a multiple of $q$ modulo $n$ and so $f^{-1}(x)=x/q$ is well-defined.
A: If $a$ and $m$ are coprimes, then, $m \nmid a^i$.
Since all reminders of $m$ belongs to the set $\{0,...,m-1\}$, by the pigeonhole principle, there exists $i,j$ large enough such that $a^i \equiv a^j (\textrm{mod}\ m)$.
$a^i \equiv a^j (\textrm{mod}\ m) \implies a^i(a^{(j-i)}-1) \equiv 0$.
But $\textrm{gdc}(a,m) = 1 \implies m \nmid a^i \implies m \mid a^{(i-j)}-1$.
So $a^{(i-j)}-1 \equiv 0 (\textrm{mod}\ m) \implies a^{(i-j)} \equiv 1 (\textrm{mod}\ m)$. This means $k=(i-j)$ will make the cycle back to 1. So if $a$ and $m$ are coprimes, the inverse will always be reached and the cycle will be closed.
If you start on 1 and reach 1, you must restart the cycle.
This proves that for any $a,m$ coprime, (including coprimes of $m$ in $\{1,...,m-1\}$) there exists $a^{-1}$. Now if each coprime to $m$ has inverse, you can explicitly build an inverse function from any cycle to any other, by just first going back to $1$ and then moving in any direction, or the other way around. So you can build an injective function from cycle 1 ($c_1$) to cycle 2 ($c_2$), $c_1 \to c_2$. But you can do the same from $c_2$ to $c_1$. Because of this, based on Schröder Bernstein Theorem, you can guarantee there is same number of elements between cycles.
