Prove that if $A^2x=x$ then $Ax=x$ I feel this should be easy but I cant solve this problem:
Prove that if $A$ is a $n\times n$ matrix and $x$ a vector in $\mathbb R^n$ both with real positive entries and $A^2x=x$ then $Ax=x$. I looking at the terms of the sum that defines the product $AAx$ and comparing with the entries of $x$ but I get nowhere. Can you give me any hints?
 A: By Perron Frobenius, since $A^2$ is a matrix with positive entries, it has a unique eigenvector with positive coefficients, and a positive eigenvalue. Likewise, $A$ is a matrix with positive entries, hence has a unique eigenvector with positive coefficients. Let this vector be $v$, and the eigenvalue be $\lambda > 0$. Then,
$$A^2 v = A (\lambda v ) = \lambda^2 v$$
which shows that $v$ is an eigenvector of $A^2$ and $\lambda = 1$ (positive root). Hence, $v$ and $x$ are the same eigenvector, which means that $v$ is a (positive) multiple of $x$. Thus, $Ax=x$.
A: This can be proven easily without using Perron-Frobenius theorem. By assumption, both $x$ and $Ax$ are eigenvectors of $A^2$ for the eigenvalue $1$. Without loss of generality, suppose $c=\frac{(Ax)_n}{x_n}\le\frac{(Ax)_j}{x_j}$ for every $j$. Then $z=Ax-cx$ is a nonnegative vector whose last entry is zero. Yet, $A^2$ is positive and $A^2z=z$. In order that the last entry of $A^2z$ is zero, $z$ must be the zero vector. Therefore $Ax=cx$ and $x=A^2x=c^2x$. Hence $c=1$ and $Ax=x$.
