Observe that tr(A)=0 implies A2=On×n and
ABA⋅ACA=On×n=ACA⋅ABA,
If tr(A)=0, we show that rank(A)=1. Let r=rank(A). Then we can find matrices X∈Mn×r(C) and Y∈Mr×n(C) with rank(X)=rank(Y)=r such that A=XY. Then YX∈Mr(C) and, as tr(A)=0, we have
r≥rank(YX)≥rank(X(YX)Y)=rank(A2)=rank(A)=r,
That is rank(YX)=r and the matrix YX is non-singular. Equality A2=tr(A)⋅A, can be written (X)2=tr(A)⋅XY, obtaining (YX)3=tr(A)⋅(YX)2. As YX is non-singular, we get YX=tr(A)⋅Ir. In conclusion,
tr(A)=tr(XY)=tr(YX)=tr(A)⋅r,
giving r=1. To conclude, let B,C∈Mn(C). We have ABA=XYBXY=pXY=pA, where p=YBX∈M1(C). In the same way ACA=qA with q∈C, concluding the result of the problem.