Let $A\in M_n(\mathbb R)$ and $B=\begin{pmatrix}A & A\\0 & A\end{pmatrix}$. Prove that $B$ is diagonalizable if and only $A = 0$.
We see that for any polynomial $P$,
$P(B) = \begin{pmatrix}P(A) & AP'(A)\\0 & P(A)\end{pmatrix}$ where $P'$ is the derivative of P
$B$ is diagonalizable $\iff \exists P$ a polynomial with single roots which annihilates B
Then B diagonalizable if and only if A diagonalizable because $P(A)=0$. A annihilates the polynomial $XP'$ too.
From there, I don't see how to prove that $A=0$
Let $M(X)\in\Bbb{R}[X]$ be the minimal polynomial of $A$. Let $P(X)\in\Bbb{R}[X]$ be a polynomial without repeated roots that annihilates $B$. Then $P(B)=0$ and so $P(A)=0$ and $AP'(A)=0$, as you note. Then $M(X)$ divides $P(X)$ and $M(X)$ dividex $XP'(X)$. Because $P(X)$ has no repeated roots, it has no common root with its derivative $P'(X)$. It follows that $M(X)$ divides $X$ and so $A=0$.