$A$ and $B$ are nonzero, square matrices. Show that if $AB=A$ and $B\not=I$ then $A$ has to be singular. That is, if $B$ is not the identity matrix of the same dimensions as $A$.
I understand that if $A$ has one $i$ row entirely of zeroes, then the corresponding entry of $B$ for $i=j$ could have any value different for $1$ and it won't affect the outcome because the zeroes would nullify it in the multiplication process. But how do I write a formal proof?
Assume that $A$ is not singular. Then there exists an inverse $A^{-1}$ of $A$. Multiplication of the equation $$AB = A$$ from the left by $A^{-1}$ yields $$A^{-1} A B = A^{-1} A.$$ Hence $$B = I.$$