I want to diagonalize the following matrix:
$$A =\begin{bmatrix} 1&0&0&0 \\ 0&0&1&0 \\ 0&1&0&0\\ 0&0&0&1 \end{bmatrix}$$
And I get the following characteristic equation: $(\lambda - 1)^3(\lambda +1)$ and therefore $\lambda=1,-1$
Firstly get the basis vectors for $\lambda = 1$ $$(A - \lambda_2 I_4) = \begin{bmatrix} 0&0&0&0 \\ 0&-1&1&0 \\ 0&1&-1&0\\ 0&0&0&0 \end{bmatrix} \rightarrow \text{row reduce} \rightarrow \begin{bmatrix} 0&1&-1&0 \\ 0&0&0&0 \\ 0&0&0&0\\ 0&0&0&0 \end{bmatrix}$$
So I have $x_2 = x_3$ wich yields the vector: $$v_1 = \begin{bmatrix} 0 \\ 1 \\ 1\\ 0 \end{bmatrix}$$
However there should be $3$ basis vectors total for $\lambda = 1$ according to the characteristic equation.
The answer key gives vectors: $$\begin{bmatrix} 1 \\ 0 \\ 0\\ 0 \end{bmatrix} , \begin{bmatrix} 0 \\ 0 \\ 0\\ 1 \end{bmatrix}$$ to be the other basis vectors for $\lambda = 1$, but where do these vectors come from in regards to my reduced matrix? I understand there ought to be 2 additional vectors to the one that I found but why are they the vectors given?
When you find eigenvectors of a matrix $A$ that corresponds to an eigenvalue $\lambda$
$$Av=\lambda v$$
or equivalently
$$\left(A-\lambda I\right)v=0$$
you need to find the basis of the null space of $A-\lambda I$, i.e.
$${\rm null}\left(A-\lambda I\right)=\left\{v|\left(A-\lambda I\right)v=0\right\}$$
You can easily see that in your case $e_{1}=\begin{pmatrix}1\\0\\0\\0\end{pmatrix}$ and $e_{2}=\begin{pmatrix}0\\0\\0\\1\end{pmatrix}$ indeed satisfy this criterion for the matrix $A-I$
$$\left(A-I\right)e_{1,2}=0$$
so these are also eigenvectors with $\lambda=1$.