If $f:\mathbb{Z}_{30}\to\mathbb{Z}_{30}$ is a function defined by $f([a])=[7a]$, show that $f$ is one-to-one and onto, and find $f^{-1}$.
I've got proof that the function is well defined, one to one, and onto. I can't seem to understand these notes I have though that shows its inverse. Maybe I took them down wrong, or missed some details?
\begin{align*} f^{-1}([b])=[a]&\iff f([a])=[b]\\ &\iff [7a]=[b]\\ &\iff 7a\equiv b\ (mod\ 30)\\ gcd(30,7)=1&\iff \exists r,s\in\mathbb{Z} \ni 30r+7s=1\\ &\iff 13\times 7-3\times 30=1\\ &\iff \end{align*}
And then there, I have something that jumps to the conclusion that $a=13b$, $[a]=[13b]$, $f^{-1}([b])=[13b]$
But I have no idea how my prof got $a=13b$ in the first place... not from looking at my notes anyhow.
The Euclidean algorithm (see also Bézout) is your friend here. It is used to write $1 = \gcd(30, 7)$ as a linear combination of $30$ and $7$: $$ 1 = 13 \cdot 7 - 3 \cdot 30.\tag{comb} $$ Then the function $g([a]) = [13 a]$ is the inverse of $f$, as $$ g(f(a)) = [13 \cdot 7 \cdot a] = [13 \cdot 7] [a] = [a], $$ as $13 \cdot 7 \equiv 1 \pmod{3}$ from (comb).