This problem has an "easy" solution, given by @Did, using that $f(x)=g(x)x-1$.
But a more general approach can be found by taking a single root, of $f(x)$, $\lambda,$ and computing the $g(\lambda)^2$, $g(\lambda)^3$:
$$\begin{align}g(\lambda)^0 &= 0\cdot \lambda^2 + &0\cdot \lambda + &1\\
g(\lambda)^1 &= 1\cdot \lambda^2 + &1\cdot\lambda + &1\\
g(\lambda)^2 &= 1\cdot \lambda^2 + &2\cdot \lambda + &2\\
g(\lambda)^3 &= 2\cdot\lambda^2 + &3\cdot\lambda + &4
\end{align}$$
(We compute these simply by multiplying and then reducing using that $\lambda^3=-\lambda^2-\lambda + 1$.)
So we want to write the vector $(2,3,4)$ as a linear combination of the vectors $(0,0,1)$, $(1,1,1)$, and $(1,2,2)$.
We can quickly see that $(2,3,4) = (1,2,2) + (1,1,1) + (0,0,1)$, so we get the equation:
$$g(\lambda)^3 = g(\lambda)^2 +g(\lambda) + 1$$
and thus our polynomial:
$$x^3-x-x-1$$
has $g(\lambda)$ as a root. Since $\lambda$ was chosen arbitrarily, this means that $g(\lambda_i)$ is a root for all $i$.