Prove that $\mathbb Z^n$ is not isomorphic to $\mathbb Z^m$ for $m\neq n$ 
Prove that $\mathbb Z^n$ is not isomorphic to $\mathbb Z^m$ for $m\neq n$.

My try:
Let $\mathbb Z^n\cong \mathbb Z^m $. To show that $m=n$.
Case 1: Let $m>n$. Now that $\mathbb Z^m$ has $m$ generators whereas $\mathbb Z^n$ has $n$  generators and an isomorphism takes a generator to generator ; that is the contradiction.
Please correct me if I am wrong.
The case  $m<n$ also follows similarly.

@Egreg's answer above is very complete and concise, but I thought I'd add another answer just for the heck of it.
Suppose toward a contradiction that there exist distinct natural numbers $m,n\in\Bbb{N}$ with $\Bbb{Z}^n=\Bbb{Z}^m$.
Let $m\in\Bbb{N}$ the least natural number for which there exists $n\in\Bbb{N}$ with $m\neq n$ such that $\Bbb{Z}^m\cong\Bbb{Z}^n$. Then $n>m>0$. Let $\varphi:\ \Bbb{Z}^n\ \longrightarrow\ \Bbb{Z}^m$ an isomorphism and $\{e_1,\ldots,e_n\}$ free generators of $\Bbb{Z}^n$. 
As $\varphi$ is an isomorphism $\{\varphi(e_1),\ldots,\varphi(e_n)\}$ is a set of free generators of $\Bbb{Z}^n$. Then the subgroups
$$H_n:=\langle e_1,\ldots,e_{n-1}\rangle\subset\Bbb{Z}^n\qquad\text{ and }\qquad H_m:=\langle\varphi(e_1),\ldots,\varphi(e_{n-1})\rangle\subset\Bbb{Z}^m,$$
are again free, so $H_n\cong\Bbb{Z}^{n-1}$ and $H_m\cong\Bbb{Z}^{m-1}$. But then the $\varphi\vert_{H_n}:\ \Bbb{Z}^{n-1}\ \longrightarrow\ \Bbb{Z}^{m-1}$
is an isomorphism, contradicting the minimality of $m$. Hence no such $m,n\in\Bbb{N}$ exist.
