Synopsis
This exercise seems so obvious that I don't know how to put it into words. A simple diagram shows this to be true. But I've tried to write down a proof anyways, and I was wondering if any of you would be willing to check that its acceptable. In other words, if you were a teacher, would you accept my proof?
Exercise
Assume that $A$ is finite and $f: A \rightarrow A $. Show that $f$ is one-to-one iff $\text{ran}f = A$.
Proof
Suppose that $f: A \rightarrow A$ is one-to-one. Then every element in $A$ must be mapped to some other unique element in $A$. Since $A$ is finite, this implies that $\text{ran}f = A$. Now suppose $\text{ran}f = A$. Then by the pigeonhole principle, in order for $f$ to be a function, $f$ must be injective.
The first one's fine, but for the second one, being more precise is a better option.
Assume for the other way that $\text{ran} ~ f =A$. As $A$ is finite, we can let $|A|=n$. Suppose there is a $x \in A$ such that there are $x_1,x_2 \in A$, $f(x_1)=f(x_2)=x$. Then there are $n-2$ elements in the domain, while there are $n-1$ in the range, and as the image of of an element is unique, by the pigeonhole principle, there must be at least one element in $A$ which does not possess a pre-image, contradicting our assumption that $\text{ran} f = A$