Is this statement true? If $A$ is an $n\times n$ matrix and $A^m=I_n$ for some $m\in \Bbb{N}$, then $A$ is invertible.
My trial
Let $n\in \Bbb{N}$ be fixed. Then, $$[\det(A)]^m=\det(A^m)=I_n=1.$$ Hence, $$\det(A)=1\neq 0.$$ Thus, $A$ is invertible since $\det(A)\neq 0.$. I'm I right or is there a counter-example?