This question comes from a multiple choice question that I will provide here:
If $n \in \mathbb{Z}, n \geq 1, a \in \mathbb{Z_n}$ and $\gcd(n;a) \sim D$ then $a$ has an inverse element $a^{-1}$ in the ring $\mathbb{Z_n}(x, +, \cdot)$ when
a)$D \sim 1$ ; b)$D = 1$ ; c) $n$ is a prime number and $D \sim 1$ ; d) $n$ is a prime number and $D = 1$
The correct answer should be a). I would like to ask for a way to approach this problem and what I would need to know to answer it. I know how to use the Extended Euclidian Algorithm and this question surely has something to do with it but I don't know how to apply that knowledge let alone prove this. Thankfully, this test does not require proofs.
All your notations are confusing, but most importantly if a and n have a gcd of 1, by Bézout you have r,s such that $$ rn + sa =1$$ On $Z/nZ$ it gives $sa =1$ (for the reciprocity you just need to do the same backwards… Most importantly if the gcd is not 1, you will have b such that $ab =0$ in $Z/nZ$ which is very bad for inversion…