I need some help solving b).
My approach is the following:
I solved a) as follows: a is a unit, find it's inverse using the extended eucledian algorithm.
For b). If c is not a unit, no problem, jsut apply a). If a is not a unit do the following:
Let $g = gcd(n,a)$. Thus $c = b*g*\frac{a}{g}$ and hene if we denote $\frac{a}{g}$ as e we see that $g|c$, so c is not a unit too. This alows us to calculate $\frac{c}{g}$ in $\mathbb{Z}$, which can be calculated efficiently. Moreover, I noticed using basic gcd properties, that $gcd(e, \frac{n}{g}) = 1$, so e is invertible in $\mathbb{Z}_\frac{n}{g}^*$. This is where I'm stuck at rn. Can someone help me finishing?