I am reading the following proof of this proposition: Let $m, x$ be positive integers such that $\gcd(m, x) = 1.$ Then $x$ has a multiplicative inverse modulo $m$, and it is unique (modulo $m$). There are 2 things about it I don't understand: 1.if $(a-b)x=km$ where $k$ is an integer, why does the fact that $x$ and $m$ are relatively prime imply that $m$ divides $(a-b)$ and 2. How can $k$ be negative or zero here (as stated by the proof) when $(a-b), x,$ and $m$ are positive? Here is the proof:
Consider the sequence of $m$ numbers $0, x, 2 x, \ldots(m-1) x$. We claim that these are all distinct modulo $m$. Since there are only $m$ distinct values modulo $m$, it must then be the case that $a x \equiv 1(\bmod m)$ for exactly one $a$ (modulo $m$ ). This $a$ is the unique multiplicative inverse of $x$. To verify the above claim, suppose for contradiction that $a x \equiv b x(\bmod m)$ for two distinct values $a, b$ in the range $0 \leq b \leq a \leq m-1$. Then we would have $(a-b) x \equiv 0(\bmod m)$, or equivalently, $(a-b) x=k m$ for some integer $k$ (possibly zero or negative).However, $x$ and $m$ are relatively prime, so $x$ cannot share any factors with $m$. This implies that $a-b$ must be an integer multiple of $m$. This is not possible, since $a-b$ ranges between 1 and $m-1$.