I'm trying to do one of my Maths past papers and I am stuck on this question:
Let $f:\mathbb{Z}_5 \rightarrow \mathbb{Z}_5$, where $f(x) = 3x+2 \pmod 5$. Find $f^{-1}(2)$ and a formula for $f^{-1}(x)$. Note that $2\times 3 = 1 \pmod 5$.
I've found that $f^{-1}(2) = 0$ but I can't find the equation for the inverse of $f(x)$ and I don't know how their clue of "Note that $2\times 3 = 1 \pmod 5$" is relevant. Please help! Thanks in advance.
Well, let $y = f(x) \in \mathbb{Z}_5$ for some $x$, then
$$ y \equiv 3x+2 \pmod 5 $$
Subtracting two from each side, we get
$$ y - 2 \equiv 3x \pmod 5 $$
Now, multiplying by 2 to each side (this is when we use the suggestion),
$$ 2y - 4 \equiv x \pmod 5 $$
So $f^{-1}(y) \equiv 2y - 4 \pmod 5$.