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.

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$.
