Prove this consequence of Cramer's theorem. Prove that for every matrix $A$ in $K^{n\times n}$, where $K$ is a field, there exists a $B$ in $K^{n\times n}$ such that $AB = BA = (\det A) \times I$ ($I$ denotes the unit matrix).
Later edit: 
Sure, for $\det A \ne 0$, $B = A^*$ satisfies the equalities, where $A^*$ is the adjoint matrix of $A$.
I would be interested in finding $B \ne O_n$ for $\det A = 0$
 A: Here is another way of producing a non-zero $B$ when $A$ is singular.
Let $x$ be a non-zero column vector such that $Ax = 0$. Since the transpose $A^\mathrm T$ is also singular, we can find a $y \in K^n$ such that $(A^\mathrm T)y = 0$, i.e. $y^\mathrm TA = 0$. Then $B = xy^\mathrm T$ will work: if $x_i$ and $y_j$ are non-zero, then the $ij$-th component of $B$ is $x_iy_j \neq 0$. [Many thanks to Srivatsan for showing me that this is enough.]
A: When $A$ is nonsingular, the adjugate matrix $\operatorname{adj} A$ already works. However, if $A$ is singular, this approach fails because it is possible that $\operatorname{adj} A = 0$. Here's one alternate approach for this case. 
Since the space of $n \times n$ matrices is finite dimensional, the infinite list of matrices $\{ I, A, A^2, \ldots \}$ is linearly dependent. Pick a linear dependence
$$
a_m A^{m} + a_{m-1} A^{m-1} + \cdots + a_{1} A^1 + a_0 I = 0
$$
among the powers of $A$ such that $m$ is as small as possible, and define $$B = a_m A^{m-1} + a_{m-1} A^{m-2} + \cdots + a_{1} I . \tag{$\dagger$}$$ 
Now, first note that $-a_0 I = A B = B A$. Taking determinants on both sides, we have $(-1)^n a_0^n = 0$. So $a_0 = 0$, and hence $AB = AB = 0$. Finally, $(\dagger)$ says that $B$ is a linear combination of the first $m-1$ powers of $A$, and hence it is nonzero by our choice of $m$. 
