Determine the set of units $(\Bbb Z/n\Bbb Z)^\times$ for different values of $n$ 
(a) Determine the set of units $(\Bbb Z/n\Bbb Z)^\times$ for $n = 4, 9, 15, 16$.
(b) For which pairs of natural numbers m and n does there exist a ring homomorphism $\Bbb Z/n\Bbb Z \to \Bbb Z/m\Bbb Z$? 

Where $\Bbb Z$ = set of integers. 
My attempts:
a) I know that $a$ in $\Bbb Z$ is a unit if there exists $b$ in Z such that $a.b = b.a = 1$ where $b$ is the inverse of $a$. 
So for $n=4$, $(\Bbb Z/4\Bbb Z)$ ={$0,1,2,3$} and $(\Bbb Z/4\Bbb Z)^\times$ = {$(1.1),(3.3)$} where "." represents multiplication. 
And for $n=9$, $(\Bbb Z/9\Bbb Z)$ = {$0,1,2,3,4,5,6,7,8$} and $(\Bbb Z/9\Bbb Z)^\times$  = {$(1.1), (2.5), (4.7), (7.9), (8.8)$}. I'll do the same procedure for $n= 15$ and $n=16$. 
But is the above correct? 
And could you please show me how part b) is done? We didn't talk about it in the lecture
 A: $a)$ The general answer to this question is that $(\mathbf Z/n\mathbf Z)^\times$ is the congruence classes of elements which are coprime to $n$, because of Bézout's identity. Its cardinal is $\varphi(n)$ (Euler's totient function).
$b)$ Consider the commutative diagram:
\begin{array}{r@{}rrrr}
\mathbf Z\\[-1ex]
|\mkern2mu&\diagdown\enspace\qquad \\[-1ex]
p_n\downarrow & \searrow p_m\\
\mathbf Z/n\mathbf Z&\mkern-10mu\xrightarrow{\;f\;}\mathbf Z/m\mathbf Z
\end{array}
where $p_m$ and $p_n$ are the canonical maps. The existence of a ring homomorphism $f$ simply means the canonical map $p_m$ can be factored through $p_n$, which in turn means $\;n\mathbf Z\subset \ker p_m=m\mathbf Z$ – in other words $m$ is a divisor of $n$, or, more expressively, the ‘target’ modulus has to divide the ‘source’ modulus.
A: For part (a), the answers are $\{1,3\}$, $\{1,2,4,5,7,8\}$, $\{1,2,4,7,8,11,13,14\}$, and $\{1,3,5,7,9,11,13,15\}$ respectively.
For part (b), the answer is that there exists a unital ring homomorphism from $\mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/m\mathbb{Z}$ if and only if $m \vert n$.
Non-unital homomorphisms, on the other hand, are a bit harder to describe. Any non-unital homomorphism $f:R \to S$ induces a unital homomorphism from $R$ to the corner ring $f(1)Sf(1)$. Also, by the Chinese remainder theorem, a corner ring of $\mathbb{Z}/m\mathbb{Z}$ is isomorphic to $\mathbb{Z}/m'\mathbb{Z}$ for some unitary divisor $m'$ of $m$. Hence, there is a one-to-one correspondence between the (not necessarily unital) homomorphisms from $\mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/m\mathbb{Z}$ and the positive integers that are simultaneously divisors of $n$ and unitary divisors of $m$.
There is always the zero homomorphism, which corresponds to the unitary divisor $1$ of $m$. The zero homomorphism is the only ring homomorphism from $\mathbb{Z}/n\mathbb{Z}$ to $\mathbb{Z}/m\mathbb{Z}$ if and only if any prime dividing $m$ does so more times than it does in $n$.
