I have been working through exercises within a book on polynomials. Part (f.) of a particular exercise asks the following :
Show that, if $p$ is a prime, and $a$ is not a multiple of $p$, then there is exactly one value of $x$ satisfying : \begin{equation} a x \equiv 1 \pmod p \text{ and } 1 \leq x \leq p - 1 \end{equation}
In part (d.) of the exercise the reader is asked to show that when : \begin{equation} ax \equiv b \pmod m \end{equation} we have : \begin{equation} g = \text{gcd}(a,m) \text{ and } g \mid b \Rightarrow ax \equiv b \pmod m \text{ has a solution} \end{equation} Here $c|d$ means $d$ is divisible by $c$. In the above equations $x \in \mathbb{Z}$ is considered a solution.
Based on the result from part (d.) I can deduce that for $g = \text{gcd}(a,p)$ : \begin{equation} g \mid 1 \Rightarrow ax \equiv 1 \pmod p \text{ has a solution } \end{equation} So we know : \begin{align} p \text{ is prime and } p \not\mid a & \Rightarrow g = \text{gcd}(a,p) = 1 \\\\ & \Rightarrow g \mid 1 \\\\ & \Rightarrow ax \equiv 1 \pmod p \text{ has a solution } \; \checkmark \end{align} So that a solution exists. The question is how can I show that there is a single solution and that : \begin{equation} x \in \{1,...,p-1\} \end{equation} Can anyone help with this ?