$ f_i=\sum a_{ij}e_j $ form a base for a free submodule $ K $ of $ R^{(n)} $ if and only if $ \det A $ is not a zero-divisor. 
Let $ R $ be commutative and let $ (e_1, ..., e_n) $ be a base for $ R^{(n)} $. Put $ f_i=\sum a_{ij}e_j $ where $ A=(a_{ij})\in M_n(R) $. Show that the $ f_i $ form a base for a free submodule $ K $ of $ R^{(n)} $ if and only if $ \det A $ is not a zero-divisor. Show that for any $ \bar{x}=x+K $ in $ R^{(n)}/K $ one has $ (\det A)\bar{x}=0 $. [Jacobson, Basic Algebra, Exercise 6, page 175]

My attempt:
Suppose $ f_i $ form a base for a free submodule $ K $ of $ R^{(n)} $ then it is clear that $ \det A $ is not a zero-divisor, because there exists a matrix $ B\in M_n(R) $, s.t. $ AB=I_n $ and we have $ \det A $ is not a zero-divisor. However, why can we get a base for a free submodule $ K $ if we only assume that $ \det A $ is not a zero-divisor? We know that if we suppose $ \det A $ is invertible, then it is trivial to see the conclusion. But why assuming not a zero-divisor also works?
 A: Your argument that if $A$ is injective then $\det A$ is a nonzero divisor is incorrect. The problem is precisely what you point out later in the paragraph. Namely that we don't know that there exists $B$ with $AB=1$, since that asserts that $A$ is surjective as well, which is certainly not always the case. Consider for example $2\Bbb{Z}\subseteq\Bbb{Z}$.
One proof is the following:
Let $A^{\newcommand\adj{\textrm{adj}}\adj}$ denote the adjugate matrix of $A$. Then 
$$A^\adj A=(\det A)1.$$
If $\det A$ is a nonzero divisor, then $(\det A)1$ is injective as a map $R^n$ to $R^n$, so $A$ must also be injective. 
On the other hand, if $\det A$ is a zero divisor, then let $b\ne 0 \in R$ satisfy $b\det A = 0$. Then localizing at $b$, we still have $A^\adj A = AA^\adj = (\det A)1$, but as maps from $R_b^n$ to $R_b^n$, and in $R_b$, $\det A=0$, so we have $AA^\adj = 0$, which implies that $A$ is not injective as a map from $R_b^n$ to $R_b^n$. However, if $A$ were injective as a map from $R^n$ to $R^n$, then $A$ would have to be injective as a map from $R_b^n$ to $R_b^n$, since localization is flat. Thus $A$ is not injective on $R^n$ either.
Edit I over simplified slightly. You have to be careful to make sure $A^\adj\ne 0$, which isn't necessarily true. Essentially you can fix things by restricting to the adjugate of a submatrix of $A$. See here for a correct proof. As a bonus it doesn't explicitly use localization.
