If $f(AB) =f(A)f(B)$, then $A$ is inversible iff $f(A)\neq 0$ Let $f:\mathscr M_n(\mathbb K) \to \mathbb K$ be a non constant function such as $f(AB) = f(A)f(B)$ for all $A,B$ in $\mathscr M_n(\mathbb K)$. The question is to show that $M\in GL_n(\mathbb K)$ iff $f(M)\neq 0$.
I've already shown that $f(Id) = 1$ and $M\in GL_n(\mathbb K) \Rightarrow f(M)\neq 0$. I'm stuck on the converse.
 A: If $M$ is invertible, $f(M)$ must be nonzero, otherwise $f(A)=f(MM^{-1}A)=f(M)f(M^{-1}A)=0$ for every matrix $A$, which is a contradiction to the assumption that $f$ is nonconstant.
Every (singular or invertible) square matrix $M$ of rank $k$ can be written in the form of $M=P(I_k\oplus 0_{n-k})Q$ for some invertible matrices $P$ and $Q$ that are products of elementary matrices (here $0_{n-k}$ denotes a zero square matrix of size $n-k$). In the previous paragraph we have established that $f(P)$ and $f(Q)$ are nonzero. So, we see that $f(M)$ is nonzero for some $M$ of rank $k$ if and only if $f$ is nonzero for every matrix of rank $k$.
Now, suppose $f$ is nonzero at some singular matrix of rank $k\ (<n)$. Then $f(A)$ is nonzero for every matrix $A$ of rank $k$. By mathematical induction, $f(B)$ is nonzero for every matrix $B$ of rank $m=k-1$ down to $0$, because
$$
f(I_m\oplus 0_{n-m}) = f\left(I_m\oplus \operatorname{diag}(1,0,\ldots,0)\right)\, f\left(I_m\oplus\operatorname{diag}(0,0,\ldots,1)\right).
$$
In particular, $f(0)$ is nonzero. Yet, $f(0)=f(0\,C)=f(0)\,f(C)$ for every matrix $C$. Hence $f=1$, which is a contradiction to the given assumption on $f$.
