Show that $m\mathbb{Z}/md\mathbb{Z} \cong \mathbb{Z}/d\mathbb{Z}$ if and only if $(d,m)=1$

Show that $m\mathbb{Z}/md\mathbb{Z} \cong \mathbb{Z}/d\mathbb{Z}$ as rings without identity if
and only if $(d,m)=1$.

I know that if $\phi : A \to B$ is a epimorphism ring and $A$ is a unit ring, so $B$ is also a unit ring. Furthermore, $(d,m)=1$ is equivalent to $\exists x \in \mathbb{Z}$ such that $\bar{m} \cdot \bar{x} = \bar{1} \in \mathbb{Z} /d \mathbb{Z}$.

I blocked on this problem for the necessity of the problem. Is anyone could help me? Does these informations may help me?

Solutions Collecting From Web of "Show that $m\mathbb{Z}/md\mathbb{Z} \cong \mathbb{Z}/d\mathbb{Z}$ if and only if $(d,m)=1$"

If $R = mZ/mdZ$ is isomorphic to $Z/dZ$, then it must have a unit element.

An element $\overline{em} \in R$ is a unit element if and only if for every $\overline{lm} \in R$, we have $emlm \equiv lm \pmod{dm}$, which is equivalent to $eml \equiv l \pmod{d}$. This is true for all $l \in Z$ if and only if it is true for $l = 1$, that is, $em \equiv 1 \pmod{d}$. The existence of an $e$ satisfying this condition is indeed equivalent to $(m,d) = 1$ by Bezout’s theorem.

Conversely, assume $(m,d) = 1$ and let $e$ be as above. Then for any $\overline{lm} \in R$, we have $\overline{lm} = lm \cdot \overline{em}$, showing that $R$ is generated by its unit element $\overline{em}$ as a group. Since $R$ also has cardinality $d$, this proves that $R$ is isomorphic to $Z/dZ$.