Let $A, B \in M_n(\mathbb{C})$ distinct matrices such that $A^2=B^2$ and $AB=BA$. Prove $\det(A+B)=0$
From $A^2=B^2$ and $AB=BA$ we get $(A-B)(A+B)=0_n$ hence $\det(A+B)=0$ or $\det(A-B)=0$.
Now suppose $A+B$ invertible. Then ${(A+B)}^2$ invertible therefore $A^2 + 2AB + B^2$ invertible and, from here, $A^2 + AB$ invertible, hence $A, B$ invertible. I can't get a contradiction for this supposition.
If $A+B$ is invertible, then $(A+B)(A-B)=0$ implies $A-B=0$, so that $A=B$, a contradiction.
(I updated the answer to take into account the update of the question.)