There is a lemma which has been stated by Chris Godsil in one of his books as follows
Let A be an n by n real symmetric matrix. If U is a nonzero A-invariant subspace of $ \mathbb{R} ^{n} $, then U contains a real eigenvector of A.
To prove this lemma I did the following
Since $ A $ is a symmetric matrix, then it is orthogonally diagonalizable. That is, there exist a $P$ such that $ P^T P =I$ and $ P^T A P = D $ is a diagonal matrix.
Now $P^T$ contains columns which are eigenvectors of $ A $. Let $v_{i}$ be a real eigenvector of $ A $ then it is in $P^T$, and it is nonzero.
Now, let $ B $ be an orthonormal basis of $ U $, then $ u_{i} \in B$ implies $ Au_{i} \in B$, and also $ u_{i} \cdot u_{j}=0 $ if $ j \neq i $ Now $v_{i}$ being a real eigenvector of $ A $ then it is in $P^T$, and it is nonzero implies that $ Av_{i}=\lambda _{i} v_{i} $ and also $ v_{i} \cdot v_{j}=0 $ if $ j \neq i $
Case 1: $ u_{i} \perp v_{i} $, then we are done.
Case 2: $ u_{i} \quad not \quad \perp v_{i} $ From $ Av_{i}=\lambda _{i} v_{i} $ we have $ (Av_{i})^{T} u_{i} =\lambda _{i} u_{i} \cdot v_{i} $ which after simplifying yields $ v_{i} \cdot Au_{i} = \lambda _{i} u_{i}\cdot v_{i} $ Thus $ v_{i} \cdot (Au_{i} -\lambda _{i} u_{i})=0$ This implies that $ Au_{i} -\lambda _{i} u_{i}=0$
This implies that $ u_{i} $ is an eigenvector of $ A $
**My request**
Possibly someone might have solved this problem. I want someone to check if the proof that I have used is correct
This lemma is actually the key step in proving that a symmetric real matrix can be diagonalized. If the subspace $U$ is $A$-invariant, then $A$ is a linear mapping from $U$ to itself, and so it can be represented by a matrix $B$ of order $m\times m$, where $m$ is the dimension of $U$. The trick is to show that $B$ is symmetric, and so by induction it has an eigenvector. This will be an eigenvector for $A$.
The difficulty in understanding this argument is that we are representing an $n\times n$ matrix by a $m\times m$ matrix. More precisely we representing the action of $A$ on $U$ by an $m\times m$ matrix.