(i) If $ax\equiv 1 \pmod{n}$ has a solution, then you can write $ax - bn = 1, b\in\mathbb{Z}$. No prime number divides $1$, so $\gcd(a,n) = 1$.
(RRA argument shows you that by assuming there is a prime $p|d=\gcd(a,n)$, you can factor $p(a'x - bn') = 1\Rightarrow p|1$, absurd.)
(ii) If $\gcd(a,n) = 1$, then we have $ax\equiv y\pmod{n}$ for arbitrary units $x\not\equiv y$ and $y$ must assume the value $1$ for some value of $x$ since $\{au_1,\ldots , au_{\phi(n)}\}$ is a reduced residue system modulo $n$ (the set of units mod $n$).
(By RRA, suppose you test all $\phi(n)$ units for $x$ but none yields $ax\equiv 1\pmod{n}$. Thus $y$ assumes less than $\phi(n)$ values. So we have a repetition such that $av\equiv u\equiv av'\pmod{n}\Rightarrow v\equiv v'\pmod{n}$ for two different units $v, v'$, contradicting $x\not\equiv y$.)