Let $K$ be a field, suppose that $D\colon M_{n\times n}(K) \to K$ is a function such that $D(AB)=D(A)\cdot D(B)$ and $D(I) \neq D(0)$, where $0$ is the zero matrix. Show that if $\operatorname{rank}(A) < n$, then $D(A)=0$.
My consideration is that: first by $D(0)=D(0)D(I)$ and $D(0)\neq D(I)$, I can show $D(0)=0$ and $D(I)=1$. then I want to show $D(I_k)=0$, where $I_k $ is $n\times n$ diagonal matrix with k diagonal entries equal to $1$ and others $0$. Then $D(A)=D(P^{-1}I_kP)=0$. However, I fail to prove $D(I_k)=0$.
Any suggestions?
Thanks a lot