Let D be an integral domain. Then if $a$ is a non-zero element in D, then $a^{2}$ is also an element of D and so is $a^{3}$ and so are all the powers of $a$. If the powers are distinct, then you will have an infinite number of elements in D, which is not possible because D is finite and hence the powers of $a$ cannot all be distinct, which means that for some $k \neq m$, $a^{k} =a^{m}$.
Here, is another way of proving that D must be a field:
Choose $\alpha \neq 0 \in D$. What we must show is that $\alpha$ is invertible, that is, we must find a $\beta \in D$ such that $\alpha \beta = 1$.
Consider the map: $f_{\alpha}: D \rightarrow D: f_{\alpha}(x) = \alpha x$. $f_{\alpha}(x) = f_{\alpha}(y) \iff 0 = \alpha x - \alpha y = \alpha (x-y)$ and since there are no zero divisors in an integral domain and $\alpha \neq 0$, $x - y = 0$ or $x = y$. So $f_{\alpha}$ is one-to-one. Since $D$ is finite, a one-to-one map must be onto. Since $f_{\alpha}$ is onto, there exists a $\beta \in D$ so that $f_{\alpha}(\beta) = 1 \implies \alpha \beta = 1$.