Can someone tell me whether my solution is okay? I based it off a proof for a more general theorem about cyclic groups and generators.
Prove that the generators of $\mathbb{Z}_n$ are the integers $r$ such that $0\leq r <n$ and $\gcd(r,n)=1$.
Let $\mathbb{Z}_{n}=\langle 1 \rangle$. Since $0\leq r <n$, $\langle r\rangle \subset \langle 1 \rangle$. Then let $\mathbb{Z}_n=\langle r \rangle$ and assume that $d=\gcd(r,n)>1$. Then there exist integers $t$ and $s$ such that $r=td$ and $n=sd$. Then $rs=tds=tn=1$ (since $|\mathbb{Z}_n|=|\langle 1 \rangle|=n$). Then $|\langle r\rangle|\leq s<n$. This forms a contradiction (if $|\mathbb{Z}_n|=n$ and $\mathbb{Z}_{n}=\langle r \rangle$ with $|\langle r\rangle|<n$, then $|\mathbb{Z}_n|\neq n$) by assuming that $\gcd(r,n)>1$.