Diagonalizability of endomorphism $f:M_2(\mathbb{R}) \to M_2(\mathbb{R})$ such that $f(A)=tr(A)I_2-A$. Let $f:M_2(\mathbb{R}) \to M_2(\mathbb{R})$ such that $f(A)=tr(A)I_2-A$. How can I determine what is the explicit expression of $f$, and, most importantly, how do I see if it is diagonalizable? The trace here confuses me a bit.
 A: Let $E_{i,j}$ be the $2\times 2$ matrix with all coefficients $0$ except $e_{i,j}=1$. Then it's easy to check that 
$$f(E_{11})=E_{22}, \quad f(E_{22})=E_{11}, \quad f(E_{12})=-E_{122}\quad f(E_{21})=-E_{21} .$$
Hence we have two eigenvectors, for the eigenvalue $-1$: $E_{12}$ and $E_{21}$.
Moreover $f(I)=I$ so $I$ is another eigenvector, for the eigenvalue $1$. Lastly $f(E_{11}-E_{22})=E_{22}-E_{11}$, so  $J=E_{11}-E_{22}$ is a third eigenvector for the eigenvalue $-1$. All three eigenvectors for the eigenvalue $-1$ are clearly independent, so we have now a basis of eigenvectors for $\mathcal M_2(\mathbf R)$. In the basis $ (I,J,E_{12}, E_{21}) $, the matrix of $f$ is
$$\begin{bmatrix}1&0&0&0\\0&-1&0&0\\ 0&0&-1&0\\0&0&0&-1 \end{bmatrix}.$$
A: First take $\lambda$ and $A$. Then $\lambda$ is a eigenvalue of $f$ with eigenvector $A$ if and only if
$$
tr(A)I-A = \lambda A,
$$
or equivalently
$$
(\lambda+ 1) A = tr(A)I.
$$
First, we consider the case $\lambda  = -1$. Then $\lambda$ is an eigenvalue
if and only if $tr(A)=0$.
Hence, the eigenspace to $-1$ is the space of all traceless matrices, which has dimension $n^2-1$. (The dimension is equal to the dimension of the kernel of $tr$, which is $n^2$ minus the dimension of the range.)
Second, consider $\lambda\ne -1$. Then $A$ is an eigenvector to $\lambda$ if and only if $A$ is a multiple of $I$. And  $\lambda$ is the eigenvalue to $A:=I$ if and only if $\lambda +1 = tr(I)$, or $\lambda=1$. 
The dimension of the eigenspace is (at least) one. 
We obtained the eigenvalues $-1$ and $+1$. The dimension of the eigenspaces sums up to the dimension of the space. Hence, $f$ is diagonalizable. This proof also works for arbitrary $n\ge2$.
A: Pick an arbitrary $A$ and let $t=\operatorname{tr}(A)$. Then
$$
f\circ f(A) = f(tI-A) = \operatorname{tr}(tI-A)I-(tI-A) = (2t-t)I-(tI-A)=A.
$$
That is, $f\circ f=\operatorname{id}$. Since $f\ne\pm\operatorname{id}$, it follows that the minimal polynomial of $f$ is $x^2-1$, which is a product of irreducible linear factors over $\mathbb R$. Hence $f$ is diagonalisable over $\mathbb R$.
