Is every self-inverse matrix diagonalizable? If $A=A^{-1}$, is there always a matrix C such that $C^{-1}AC$ is a diagonal
 matrix (containing only -1 and 1 in the main diagonal) ?
How can I check with PARI/GP, if a given matrix is diagonalizable ?
I only found out that $A=A^{-1}$ implies $C^{-1}AC=(C^{-1}AC)^{-1}$ for any
 invertible C, but this does not answer my question.
Additional question : If A has integer entries, is there always a matrix C with
 INTEGER values such that $C^{-1}AC$ is a diagoal matrix and $C^{-1}$ has also integer
 values ? For example, I did not find such a matrix for 
 A = [ [11,-16,-4] [9,-13,-3] [-6,8,1] ] yet.
 A: Hint: in this case,
$$
A\times A=I\implies P(A) = 0, \\P = (X-1)(X+1)
$$
I assume that $1+1\neq 0$. In that case, $X\pm 1$ are different factors.
Some theorem (Lemme des noyaux in french, does anyone know the english term?)
states the second inequality in: $$E = \ker  P(A) =\ker (A-I) \oplus \ker (A+I)$$
A: You can rewrite that condition as $A^2 = I_2$. Therefore $A$ is a root of $X^2 - 1$.


*

*Case 1: the characteristic of the base field is not $2$ (for example $\mathbb{R}$, $\mathbb{C}$...), then this polynomial is split with simple roots, so $A$ is diagonalizable. The eigenvalues will be roots of $X^2 - 1$ so they will indeed only be either $1$ or $-1$.

*Case 2: the characteristic is $2$. Then $\bigl(\begin{smallmatrix} 1 & 1 \\ 0 & 1 \end{smallmatrix}\bigr)^2 = I_2$ is a counterexample.

A: $A$ is a root of the polynomial $f = x^{2} -1$, which has distinct roots. Thus its minimal polynomial, which divides $f$, has distinct roots. It follows that $A$ is diagonalizable.

This assumes that $1 \ne -1$. that is, the characteristic of the underlying field is not $2$. In characteristic $2$, the matrix
$$
A =
\begin{bmatrix}
1 & 1\\
0 & 1
\end{bmatrix}
$$
satisfies $A = A^{-1}$, but it is not diagonalizable.
A: Answer to second question:  "matrank(mateigen(a)) = matsize(a)[1]", 
if you know the matrix a is square.  If not, append "= matsize(a)[2]"
