Let us denote d=det(X) and t = (X). From the assumption X2023=X2022, we obtain d2023=d2022. Therefore, d∈{0,1}.
If d=1, then X is invertible. Then X2022 is also invertible. We find X=I2. So, the relation X3=X2 is verified.
Assume now d=0. The Cayley-Hamilton theorem implies X2=tX. So we obtain Xn+1=tnX,∀n∈N∗. Hence t2022X=t2021X. We get t=0 or t=1 or X=O2.
If t=0, then X2=O2, so X3=X2=O2.
If t=1, then X2=X, so X3=X2.
If X=O2, then clearly X3=X2=O2.