Let $A$ a $4\times 4$ matrix over the reals with $A^3-A^2+A=0$ That means that its minimal polynomial is: $x$ or $x^2-x+1$ or $x^3-x^2+x$ In the first case $A=0$. The second case is $$ \begin{pmatrix}0&-1&0&0\\1&1&0&0\\0&0&0&-1\\0&0&1&1\end{pmatrix}? $$ And for the last one $$ \begin{pmatrix}0&0&0&0\\0&0&0&0\\0&0&0&-1\\0&0&1&1\end{pmatrix}? $$
For the 2nd case: Since $m(x)=x^2-x+1$ and the characteristic polynomial has degree 4, the only possibility is $\chi(x)=(x^2-x+1)^2$ and from the rational canonical form I found the matrix as above, up to similarity. For the 3rd case: Since complex roots come in pairs the characteristic polynomial is $\chi (x)=x^2(x^2-x+1)$ and again using the rational canonical form I found the matrix I wrote.