Let $R$ be a ring and $M$, $N$ finitely generated free modules modules over $R$. Let $A$ be a matrix representing a homomorphism $f: M \rightarrow N$. We know that the map $f$ is injective if and only if the columns of $A$ are linearly independent.
Now suppose $f$ is NOT injective. By the first isomorphism theorem, we know that the induced map $\bar{f}: M/ \ker f \rightarrow N$ is injective. But the matrix representing $f$ and $\bar{f}$ is the same, right? Then how does the above make sense?
First of all, the quotient $M/\ker f$ may not be free -- consider $\mathbb{Z} \to \mathbb{Z}/2\mathbb{Z}$. The criterion relating injectivity of $f$ to linear independence of the columns of $A$ works in the case where both source and target are free, but not necessarily otherwise.
If the quotient $M/\ker f$ is free, the matrix will not necessarily be the same -- for example, consider the projection $\mathbb{Z}^2 \to \mathbb{Z}$ onto the first factor: the number of columns of the matrix changes from $2$ to $1$.