I need to prove that for every real linear operator $T:\mathbb{R}^n\longrightarrow \mathbb{R}^n$, there exists an orthonormal basis of $\mathbb{R}^n$ such that the corresponding matrix is block diagonal and each block is $1\times 1$ or $2\times 2$.
I've spent hours trying to prove that but I haven't a clue.
I'll be really grateful for any help.
You should stop trying because this is false. Otherwise, this would make the whole Jordan normal form theory almost pointless. Indeed, when there are $1$'s on the super diagonal of the Jordan normal form, we can't get rid of them like that.
Consider for instance the matrix $$ A=\left(\matrix{0&1&0\\0&0&1\\0&0&0} \right). $$ Note that the characteristic polynomial of $A$ is $x^3$. If the result was true, $A$ would be similar to a block diagonal matrix with blocks of size $1\times 1$ or $2\times 2$. Without loss of generality, we would get $$ PAP^{-1}=\left(\matrix{*&0&0\\0&*&*\\0&*&*} \right) $$ including the three $1\times 1$ blocks case. Given that the characteristic polynomial $x^3$ of $A$ is the product of the characteristic polynomials of these two diagonal blocks, we see that the $1\times 1$ block is $0$, and the $2\times 2$ block is triangularizable with $0$ diagonal, as its characteristic polynomial $x^2$ splits. So without loss of generality, $$ PAP^{-1}=\left(\matrix{0&0&0\\0&0&*\\0&0&0} \right). $$ On one hand, the rank of $A$ is $2$. On the other hand, the rank of $PAP^{-1}$ is $0$ or $1$. Contradiction.