Matrices such that $M^2+M^T=I_n$ are invertible 
Let $M$ be an $n\times n$ real matrix such that  $M^2+M^T=I_n$. Prove that $M$ is invertible

Here is my progress:


*

*Playing with determinant:


one has $\det(M^2)=\det(I_n-M^T)$ hence $\det(M)^2=\det(I_n-M)$
and $\det(M^T)=\det(I_n-M^2)$, hence $\det(M)=\det(I_n-M)\det(I_n+M)$
Combining both equalities yield $$\det(I_n-M)(\det(I_n-M)\det(I_n+M)-1)=0$$


*

*Playing with the original assumption:


transposing  yields $(M^T)^2+M=I_n$, and combining gives $(M^2-I_n)^2=I_n-M$
that is $M^4-2M^2+M=0$.
$M$ is therefore diagonalizable and its eigenvalues lie in the set $\{0,1,-\frac{1+\sqrt{5}}{2},\frac{1-\sqrt{5}}{2}\}$


*

*Misc


Multiplying $M^2+M^T=I_n$ by $M$ in two different ways, one has $MM^T=M^TM$


*

*Looking for a contradiction ?


Supposing $M$ is not invertible, there is some $X$ such that $MX=0$. This in turn implies $M^TX=X$... So what ?

We can find explicitly the real matrices $M$ that satisfies $M^2+M^*=I$. According to the DODOM's post, $M$ is a normal matrix, and consequently, is diagonalizable over $\mathbb{C}$ by a unitary change of basis. Then $M=Pdiag((m_i)_i)P^{-1}$ where, for every $i$, $m_i^2+\overline{m_i}=1$. Since $M$ is real, there is a unitary $P$ s.t. $M=Pdiag(\lambda_1,\cdots,\lambda_k,p_1+iq_1,p_1-iq_1,\cdots,p_r+iqr,p_r-iq_r)P^{-1}$ where $n=k+2r$ and the $(\lambda_j,p_s,q_s\not=0)$ are real; morover $\lambda_j^2+\lambda_j=1$ (that implies $\lambda_j=(-1\pm\sqrt{5})/2)$ and $p_s^2-q_s^2+p_s+i(2p_sq_s-q_s)=1$  (that implies $p_s=1/2,q_s^2=-1/4$, that has no solutions).
Finally, there is an orthogonal matrix $Q$ s.t. $M=Qdiag(((-1+\sqrt{5})/2)I_p,((-1-\sqrt{5})/2)I_q)Q^{-1}$ where $p+q=n$. Note that $M$ is necessarily symmetric.
