I want to show
Let $A$ be a $n \times n$ matrix with only real eigenvalues. Then there is a basis of $\Bbb R^n$ with respect to which $A$ becomes upper triangular.
There is a hint which says: Construct a basis $B := \{v_1,v_2,\ldots,v_n\}$ of $\Bbb R^n$ where $v_1$ is an eigenvector.
I can see why $[T]_B$ would be upper triangular, if all $v_i$ are eigenvectors, because then $[T]_B$ is diagonal. But if not all are eigenvectors, how do I choose the one which are not eigenvectors, such that $[T]_B$ is upper triangular?
I've included what I have so far below, but it's basically the above just written down. And I realized to late that those multiple indices are a real pain. I should've have just assumed w.l.o.g. that there is only one eigenvector for each eigenvalue. You don't need to read all of it through, the question is the same as above.
This might be related to this question, but I don't understand the answer to it. We also didn't discuss the Jordan canonical form yet, so if there is maybe a simpler way to proof this, I'd appreciate your help!
Let $T:\Bbb R^n \to \Bbb R^n$ be the linear transformation associated with $A$ and let $\lambda_1,\ldots,\lambda_k$ be its eigenvalues with algebraic multiplicity $m_1,\ldots,m_k$, which are all real. Let $B_i := \{v^i_1,\ldots,v^i_{d_i}\}$ be a basis of the eigenspace $E_i$ of $\lambda_i$ which has $\text{dim}(E_i) =: d_i$. Now we try to build a basis for $\Bbb R^n$ consisting of eigenvectors. Let
$$B := B_1 \cup \ldots \cup B_k = \{v^1_1,\ldots,v^1_{d_1},v^2_1,\ldots,v^2_{d_2},\ldots\ldots,v^k_1,\ldots,v^k_{d_k}\}$$
If $B$ is a basis of $\Bbb R^n$ then we are done, since there exists a basis of $\Bbb R^n$ of eigenvectors of $A$ and hence $A$ is diagonalizable, which means it is diagonal in this basis $B$. And a diagonal matrix is also upper triangular.
If $B$ is not a basis of $\Bbb R^n$, then we need to add additional vectors $\{w_1,\ldots,w_l\}$, so that $B \cup \{w_1,\ldots,w_l\}$ is a basis of $\Bbb R^n$. We have
$$[T]_B = \begin{bmatrix} \vert & & & \vert & \vert & & \vert \\ [T(v^1_1)]_B & \ldots & \ldots & [T(v^k_{d_k})]_B & [T(w_1)]_B & \ldots & [T(w_l)]_B \\ \vert & & & \vert & \vert & & \vert \end{bmatrix}$$
Now since $T(v^i_j)=\lambda_i v_j$ we have
$$[T(v^i_j)]_B=\begin{bmatrix} 0 \\ \vdots \\ \lambda_i \\ \vdots \\ 0 \end{bmatrix}$$
where only the one entry corresponding to $v^i_j$ is a $\lambda_i$ and the rest zero. Leaving the $T(w_j)$ random first, we get almost a diagonal matrix with the eigenvalues on the diagonal except for the last $l$ columns.
$$[T]_B = \begin{bmatrix} \lambda_1 & & & & & * & \ldots & * \\ & \ddots & & & & & & \\ & & \lambda_1 & & & \vdots & & \vdots \\ & & & \ddots & & & & \\ & & & & \lambda_k & * & \ldots & * \\ & & & & & & & & \\ & & & & & \vdots & & \vdots \\ & & & & & & & \\ & & & & & * & \ldots & * \end{bmatrix}$$
For $[T]_B$ to be diagonal, the $w_j$ needs to be chosen, so that there are only stars above the diagonal. This means that $T(w_j)$ needs to be a linear combination of only the basis vectors before this specific $w_j$, which are all the $v^i_j$ and some of the $w_j$, i.e. $T(w_j) = \sum_{i,j} c^i_j v^i_j + \sum_{k}^j c_k w_k$ for some constants $c^i_j,c_k$, because then
$$[T(w_j)]_B=\begin{bmatrix} c^1_1 \\ \vdots \\ c^k_{d_k} \\ c_1 \\ \vdots \\ c_j \\ 0 \\ \vdots \\ 0 \end{bmatrix}$$
where the last possible non-zero entry $c_j$ corresponds to $w_j$. Therefore $[T]_B$ would be upper triangular.
How do I know that such a linear combination for $w_j$ exists and how could I choose it?