suppose φ:nZ-->mZ is a ring isomorphism. then φ(n) = mk, for some integer k.

since φ is a ring homomorphism, φ(n^2) = φ(n+n+...+n) (n times)

= φ(n)+φ(n)+...+φ(n) (n times)

= n(φ(n)) = n(mk). but φ(n^2) = [φ(n)]^2 = (mk)^2 as well, leading to n = mk. in general, this is not true.

in fact, you can even show that mZ and (km)Z are not isomorphic (unless k = ±1), in much the same way:

φ(m) = r(km) = (rk)m for some integer r. so φ(m^2) = (rkm)^2 = r^2k^2m^2, but also φ(m^2) = m(φ(m)) = (rk)m^2.

thus rk = 1, which means that k = ±1.