This is problem $15$ from Chapter $3$ of Atiyah and Macdonald's book.
Let $A$ be a ring let $F$ be the $A$-module $A^{n}$. Show that every set of $n$ generators is a basis of $F$.
Here's the hint:
Let $x_{1},...,x_{n}$ be a set of generators of $F$ and let $e_{1},...,e_{n}$ be the canonical basis of $F$. Let $\phi: \rightarrow F$ be defined by $\phi(e_{i})=x_{i}$. Then $\phi$ is surjective and we may assume $A$ is local. Let $N=\ker(\phi)$ and let $k=A/\mathfrak{m}$ be the residue field of $A$. Since $F$ is a flat $A$-module then the exact sequence:
$$0 \rightarrow N \rightarrow F \rightarrow F \rightarrow 0$$
induces an exact sequence
$$0 \rightarrow k \otimes N \rightarrow k \otimes F \rightarrow k \otimes F \rightarrow 0.$$
First question: we actually need to assume $A^{n}$ is local no? because $F=A^{n}$ but if $A^{n}$ is local then so is $A$ right? because every maximal ideal $M_{i}$ of $A^{n}$ is of the form $A_{1} \times A_{2} \times... M_{i} \ ... \times A_{n}$. And if $A$ is local then $A^{n}$ is local so $A$ is local iff $A^{n}$ is local. Is this the reasoning behind the hint?
Second question: The part I don't understand is why when tensoring with $k$ the sequence remains exact? we know that $F$ is flat because it is free so tensoring any exact sequence with $F$ remains exact, but why tensoring with $k$ also remains exact? it seems that we are assuming $k$ is a flat $A$-module, but why is this?