Let $p>3$ be a prime number. Prove that for every $a$, $1$ $\lt$ $a$ $\lt$ $p-1$ Let $p>3$ be a prime number. Prove that for every $a$, $1$ $\lt$ $a$ $\lt$ $p-1$, there is a unique b $\neq$ a , $1$ $\lt$ b $\lt$ $p-1$ such that $ab$ $\equiv$ (1 mod p)
I started off with a proof of contradiction where suppose b is not unique and b can equal a. Then by substitution we have $a*a$ $\equiv$ $1 (mod$ $p)$.  Not sure how to proceed further. Just to clarify, isn't $1 (mod$ $p)$ always 1? So $a*b$ has to be $pk+1$, k=1,2,3,...? 

Let $P= \{0, 1, \dots, p-1\}$ and consider $\mu: P \to P$ given by $x \mapsto ax \bmod p$. Then, $\mu$ is injective (*) and so is surjective, because $P$ is finite. Therefore, $\mu$ is bijection and there is a unique $b \in P$ such that $1=\mu(b)=ab \bmod p$.
This defines a map $\iota: P \to P$ given by $a \mapsto b$ such that $ab \equiv 1 \bmod p$. This map $\iota$  is its own inverse and so is a bijection. Since $\iota(1)=1$ and $\iota(p-1)=p-1$, we get $1 < a < p-1 \implies 1 < b=\iota(a) < p-1$. Finally, $\iota(a)=a$ iff $a^2\equiv 1 \bmod p$, that is, $p$ divides $a^2-1=(a-1)(a+1)$ and so $a\equiv \pm 1 \bmod p$, that is $a=1$ or $a=p-1$.
(*) If $ax \bmod p = ay \bmod p$, then $p$ divides $a(x-y)$. Since $p$ does not divide $a$, it must divide $x-y$. Since $|x-y|<p$, we must have $x-y=0$ and so $x=y$.
