We have the matrix $A=\begin{pmatrix}1 & 1 & 0 \\ 0 & 2 & 1 \\ 0 & 0 & -1\end{pmatrix}$ and let $\phi:\mathbb{R}^3\rightarrow \mathbb{R}^3, \ x\mapsto Ax$ be the endomorphism to $A$.
I have found the eigenvalues which are $1,2,-1$. Since we have three dinstinct eigenvalues it follows that $A$ and so also $\phi$ is diagonalizable.
Is that correct?
Then for each eigenvalue I calculated the eigenspaces. The set of the three eigenvectors forms a basis of $\mathbb{R}^3$, right?
I want to determine all subspaces $U$ of $\mathbb{R}^3$ such that $\phi (U)=U$.
How can we do that? Is this maybe related to the eigenvectors?
What you did is fine. And now, if $v_1$, $v_2$ and $v_{-1}$ are eigenvalues corresponding to the eigenvalues $1$, $2$, and $-1$ respectively, then the subspaces $U$ of $\Bbb R^3$ such that $\phi(U)=U$ are:
It is clear that each of these spaces is invariant. On the other hand, let $U\subset\Bbb R^3$ be such that $\phi(U)\subset U$. If $\dim U$ is $0$, $1$ or $3$, it's clear that $U$ belongs to the list from above. If $\dim U=2$, let $\psi\colon U\longrightarrow U$ be the restriction of $\phi$ to $U$. So, $\psi$ has $2$ complex eigenvalues, which must be a subset of $\{1,2,-1\}$. But then $U$ has to be one of the $3$ $2$-dimensional spaces from above.