Matrices similar only to themselves Find all matrices similar only to themselves, i.e., $PTP^{-1}=T$ for any invertible $P$.
My attempt: $PT = TP$.
Am I going about this correctly? If so, how do I find all matrices that are commutative (where $P$ is invertible)?
 A: Let us denote the elements of $T$, $P$, and $X := PTP^{-1}$ as $t_{ij}$, $p_{ij}$, and $x_{ij}$ respectively.
Assume that $T$ is not diagonal. That means that $t_{ij} \ne 0$ for some $i \ne j$. Now, let $P$ be the same as identity except for $p_{ii} = 2$, i.e.,
$$P = \operatorname{diag}(\underbrace{1,\dots,1}_{i-1},2,\underbrace{1,\dots,1}_{n-i}).$$
Then
$$P^{-1} = \operatorname{diag}(\underbrace{1,\dots,1}_{i-1},1/2,\underbrace{1,\dots,1}_{n-i}).$$
It is easy to see that
$$x_{ij} = p_{ii} \cdot t_{ij} \cdot p_{jj}^{-1} = 2t_{ij} \ne t_{ij}.$$
Hence, $T$ must be a diagonal matrix.
Let us now assume that there exist $i,j$ such that $t_{ii} \ne t_{jj}$. In this case, let $P$ be the identity matrix with $i$-th and $j$-th rows (or columns) swapped. In this case, $P$ is a permutation (so, $P^{-1} = P^T$) and $X$ is obtained from $T$ by swapping $i$-th and $j$-th elements of the diagonal, so $X \ne T$.
In other words, $T = \lambda I$ for some $\lambda$. This is a necessary condition.
To check that it is also a sufficient one, we need to check that every such $T$ satisfies what we want. This is easy:
$$PTP^{-1} = P(\lambda I)P^{-1} = \lambda PP^{-1} = \lambda I = T.$$
