If we have $A_{n \times n}$ and $AX-XA=A$, how do we show that $\det(A)=0$?
I've tried taking the trace on both sides to get
$$tr(AX)-tr(XA)=tr(A)$$ $$tr(AX)-tr(AX)=tr(A)$$ $$0=tr(A)$$
However, that doesn't necessarily show that $\det(A)=0$
If we have $A_{n \times n}$ and $AX-XA=A$, how do we show that $\det(A)=0$?
I've tried taking the trace on both sides to get
$$tr(AX)-tr(XA)=tr(A)$$ $$tr(AX)-tr(AX)=tr(A)$$ $$0=tr(A)$$
However, that doesn't necessarily show that $\det(A)=0$
Rewrite the equation as $A (X-I) = XA$. If $A$ is nonsingular, that implies $X - I = A^{-1} X A$, i.e. $X$ is similar to $X-I$. That says $\lambda$ is an eigenvalue of $X$ if and only if $\lambda$ is an eigenvalue of $X-I$, i.e. $\lambda+1$ is an eigenvalue of $X$. But this is impossible, as it would mean $\lambda+n$ is an eigenvalue of $X$ for every integer $n$, but $X$ has only finitely many eigenvalues.
Similar to Robert Israel's answer, but without explicitly using eigenvalues: If $A$ were invertible, we could multiply the given equation on the right by $A^{-1}$ to get $AXA^{-1}-X=I$. Taking the trace of both sides and remembering that $AXA^{-1}$ has the same trace as $X$ (and that trace is linear), we get that the trace of the identity matrix is $0$, a contradiction.
[Pedantic technicality: That final "contradiction" assumes that you don't allow $0\times0$ matrices. If you do allow them, the result is false, as the hypothesis holds when both $A$ and $X$ are the empty matrix, but the determinant of the empty matrix is $1$.]
Suppose $\det A \ne 0$.
Left-multiplying $A^{-1}$ on both sides of $AX - XA = A$, we have $X - A^{-1}XA = I$.
Right-multiplying $A^{-1}$ on both sides of $AX - XA = A$, we have $AXA^{-1} - X = I$.
Add them up to get $AXA^{-1} - A^{-1}XA = 2I$.
Note that $\mathrm{Tr}(AXA^{-1}) - \mathrm{Tr}(A^{-1}XA) = \mathrm{Tr}(X) - \mathrm{Tr}(X) = 0$, and $\mathrm{Tr}(2I) \ne 0$.
Contradiction. (Q. E. D.)