Prove $\rm AB = BA = 0$ if the set of nonzero eigenvalues of $\rm A + B$ is union of set of nonzero eigenvalues of $\rm A$ and $\rm B$.

Edit: As stated this is not true. Take $$A=\begin{bmatrix}2 &0 &0\\0&1 &0 \\ 0 & 0&0\end{bmatrix} \text{ and } B= \begin{bmatrix}0 &0 &0\\0&1 &0 \\ 0 & 0&1\end{bmatrix}$$ then $AB \ne 0$, but $A,B, A+B$ fulfill the hypothesis. So you can either assume that $A,B$ are positive semi-definite as orangeskid did or assume that the multiplicities add up as I will do:

What do we know about a diagonalizable matrix $M$? By looking at eigenspaces with non zero eigenvalue and the eigenspace with eigenvalue zero we get the decomposition $$k^n= \operatorname{im} M \oplus \ker M$$

They are an isomorphism when restricted to their image.

By counting eigenvalues we know that $$\operatorname{rank}{A}+ \operatorname{rank}{B} = \operatorname{rank}{(A+B)}.$$

This gives us $\dim\text{im}{A} + \dim \text{im}{B} =\dim \text{im}{(A+B)}$ by looking at the dimension of subspaces we know that the intersection must be $0$ and thus $$\operatorname{im}{A} \oplus \operatorname{im}{B} =\operatorname{im}{(A+B)}.$$

In other word we get a decomposition $$k^n = \operatorname{im}{A} \oplus \operatorname{im}{B} \oplus \ker (A+B).$$

How does $\ker (A+B)$ looks like? We know that $\ker(A) \cap \ker(B) \subset \ker (A+B)$, but since $\operatorname{im}{A} $ and $\operatorname{im}{B} $ only intersect at zero we get equiality.

Thus $$k^n = \operatorname{im}{A} \oplus \operatorname{im}{B} \oplus( \ker(A) \cap \ker(B)),$$

hence we can assume that $A+B$ is an isomorphism and diagonalize $A$ and $B$ on their images.

Let $O$ be orthonormal such that $A$ is diagonalized on $\operatorname{im} A$ and let $U$ be orthonormal such that $B$ is diagonalized on $\operatorname{im} B$

Choose appropriate $M,N,C$ such that $$A+B=\begin{bmatrix}M &C\\ C^T& N\end{bmatrix} $$

then

$$T= \begin{bmatrix}O^T &0\\ 0& U^T\end{bmatrix} \begin{bmatrix}M &C\\ C^T& N\end{bmatrix} \begin{bmatrix}O &0\\ 0& U\end{bmatrix} = \begin{bmatrix}O^T M O & O^T CU\\ U^T C^TO& U^TNU \end{bmatrix} . $$

Now let us consider the trace of the square of $T$ \begin{align*} \operatorname{tr}(T^2) &= \operatorname{tr} (O^T M^2O + O^TC C^TO)+ \operatorname{tr} (U^T N^2U + U^TC^T CU) \\ &= \sum \lambda_i + \operatorname{tr}(CC^T) + \sum \mu_i + \operatorname{tr}(C^TC) \end{align*}

where $$ \operatorname{tr}(T^2) = \operatorname{tr}(A+B)^2 = \sum \lambda_i + \sum \mu_i $$ and $\operatorname{tr}(CC^T) >0,$ thus we can conclude that $$ C=0.$$

Hence $T$ is diagonal, thus we have $\operatorname{im}A \subset \ker B$ and $\operatorname{im}B \subset \ker A$.


Just some thoughts and a partial answer:

The condition is equivalent to $$\operatorname{Trace} A^k + \operatorname{Trace}B^k = \operatorname{Trace}(A+B)^k$$ for all $k\ge 1$.

For $k=2$ this implies $\operatorname{Trace}AB = 0$.

If we had the extra hypothesis $A$, $B$ positive semi-definite this would imply $AB = 0$. Indeed, $$ \operatorname{Trace} (\sqrt{B} \sqrt{A})(\sqrt{A} \sqrt{B})=\operatorname{Trace}AB =0$$ implies $\sqrt{A} \sqrt{B} = 0$ and so $AB = 0$.

$\bf{Added:}$ Another possible approach inspired by the source given by @Jose Brox: is to use the equivalent condition for the characteristic polynomials $$P_A(\lambda) \cdot P_B(\lambda) = \lambda^n P_{A+B}(\lambda)$$


I have finally found the answer in the paper A simple proof of the generalized Craig-Sakamoto theorem by Jin Zhang and Jikun Yi:

a) If $r+s=n$ they cleverly write $A+B$ in terms of $A$ and $B$, as follows:

$$A=\left(\array{A_1 & 0 \\ 0 & 0}\right), B=T\left(\array{0 & 0 \\ 0 & B_1}\right)T'$$ with $A_1=$diag$(\lambda_1,\ldots,\lambda_r)$, $B_1=$diag$(\mu_1,\ldots,\mu_s)$, $T=\left(\array{T_1 & T_2 \\ T_3 & T_4}\right)$ orthogonal, so that $$A+B=\left(\array{I & T_2 \\ 0 & T_4}\right)\left(\array{A_1 & 0 \\ 0 & B_1}\right)\left(\array{I & 0 \\ T_2' & T_4'}\right).$$

Then, by hypothesis, $$|A_1||B_1|=|A||B|=|A+B|=|A_1||B_1||T_4'T_4|,$$ which implies $|T_4'T_4|=1$. But $1=|I_s|=|T_2'T_2+T_4'T_4|\geq |T_2'T_2|+|T_4'T_4|$ since the matrices are positive semidefinite (why?), hence $|T_2'T_2|=0$, so that $T_2=0$. This implies $AB=0$.

b) If $r+s<n$, then as rank$(A+B)=$rank$(A)+$rank$(B)$ while rank$(A+B)\leq$rank$\left(\array{A \\ B}\right)\leq$rank$(A+B)$, we get equality of the three ranks. Therefore there exists an orthogonal matrix $P=(p_1 \ldots p_n)$ such that $Ap_i=Bp_i=0$ for every $i\in\{1,\ldots,n-r-s\}$. This matrix serves to give a common "block-triangularization" $$P'AP=\left(\array{0 & 0 \\ 0 & A^*}\right), P'BP=\left(\array{0 & 0 \\ 0 & B^*}\right)$$ in which $A^*,B^*$ satisfy the hypotheses of point a), hence $A^*B^*=0$, hence $AB=0$.