Assume the set $A$ is finite and there is a function $f$ from $A$ to $A$. Then, $f$ is injective if and only if $\operatorname{ran} f = A$ 

I feel lost on how to prove this. I can visualize that since $A$ has a finite number of members that any injective mapping from $A$ to itself would be surjective, i.e. $\operatorname{ran} f = A$. But I have no idea how to go forward formally with a proof. I know the definitions of finite and injectivity, but where would I proceed to from those definitions?