4 edited to make confusion less likely, I hope

Is it true that the cardinality of every maximal linearly independent subset of a finitely generated free module $A^{n}$ is equal to $n$? n$(not just at most$n$, but in fact$n$)? Here$A\neq 0$A$ is a nonzero commutative ring. I know that it's true if $A$ is Noetherian or integral domain. I thought it was not true in general but I came up with something that looks like a proof and I can't figure out where it went wrong.

Is it true that the cardinality of every maximal linearly independent subset of a finitely generated free module $A^{n}$ is $n$? Here $A\neq 0$ is a commutative ring. I know that it's true if $A$ is Noetherian or integral domain. I thought it was not true in general but I came up with something that looks like a proof and I can't figure out where it went wrong.