This question already has an answer here:
Let $A$ be a commutative ring with $1,$ and $\phi : A^n \to A^n $ be a surjective $A$-linear map for some natural number $n.$ Then show that $\phi$ is injective as well.
Tensoring with $A/m$ for some maximal ideal $m$ in $A$ will give that tensor map is onto and being $A/m$ linear is injective. But from this map I cannot recover $\phi$ and claim that $\phi$ is also injective. Any help will be appreciated. Thanks.