Let $R$ is a ring, $M$ is a $n \times n$ matrix over the ring $R$ (i.e. $M \in M_n(R)$). I need to prove that $\exists M' \in M_n(R)$ such that $M' M = \det M \cdot E$, where $E \in M_n(R)$ is the identity matrix.
My proof is the following:
If $\det M = 0$ then we can assume $M' = 0$
If $\det M \ne 0$ then there exists $M^{-1}$ and therefore $M' = \det M \cdot M^{-1}$ will work.
Are there any errors in the proof?
The ring $R$ should be commutative in order for the determinant to be defined.
However, if a matrix has nonzero determinant, it may not be invertible. Consider, for instance, $R=\mathbb{Z}$ and $$ M=\begin{bmatrix} 1 & 1 \\ 0 & 2 \end{bmatrix} $$ in $M_2(\mathbb{Z})$, which has nonzero determinant but is not invertible.
The result is true nonetheless. Hint: consider the adjugate matrix of $M$.