I'm trying to show that the smallest $r \geq 1$ such that $$a^r \equiv 1 \mod N$$ always satisfies $r < N$ given that $\gcd(a, N) = 1$.
I am under the impression that for coprime $a$ and $N$, if $x \neq y$ and $0 < x \leq N$ and $0 < y \leq N$, then $$a^x \mod N \neq a^y \mod N$$ Thus, every number from $0$ to $N-1$ is made in $$a^{\{1, 2, ..., N \}} \mod N$$ which proves that the order cannot be greater than $N$. But I have no idea if this is true, and cannot prove it.
Take all the congruency classes $a^1,a^2,\ldots,a^N$ modulo $N$. None of them can be $0$, and the are $N$ of them, so by the pigeonhole principle, two of them must be equal. Say $a^m\equiv a^n\pmod N$ with $m<n$. Then $a^{n-m}\equiv 1\pmod N$ and $0<n-m<N$.