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.