Given three real $n\times n$ matrices $X,Y,Z$ satisfying the following conditions: $$XZ=ZX$$ $$YZ=ZY$$ $$\mathrm{rank}(XY-YX+I)=1,$$ prove that $Z=aI$ for some real number $a$.
One possible solution to this problem has been sketched in the comments years ago. The idea is that, up to conjugation by a complex invertible matrix, we can assume $Z$ to be a Jordan matrix. This forces the matrices $X,Y$ to have a precise block structure and the remaining part of the proof should be achieved after some rather long computation.
I would like to know if the problem can be solved in an easier/faster way.
$XY=YX$ implies $XY-YX=0$ we deduce $XY-YX+I=I$ so $X,Y,Z$ are one dimensional matrices since the rank of $I$ is $1$ and $Z=aI$.