The exercise goes as follows:
Use the Lagrange interpolation formula to find a polynomial $f$ with real coefficients such that $f$ has degree $\leq3$ and $f(-1)=-6, f(0)=2, f(1)=-2, f(2)=6$.
So to start, I wrote down the formula $$f=\sum^n_{i=0}f(t_i)P_i$$ But I didn't manage to get much further than that. I understand that $P_i$ are polynomials of degree $i$, but I'm not sure how I can do anything with that information.
Your data pairs $(x_i, f_i)$, $0\leq i\leq 3$ are $(-1, -6), (0, 2), (1, -2)$ and $(2, 6)$. The $3$-degree polynomial $P_3(x)$ that you would get using Lagrange's interpolation is $$P_3(x)=\sum_{i=0}^3f_iL_i(x)$$ where $$L_i(x)=\prod_{j=0\\ j\neq i}^3\dfrac{x-x_j}{x_i-x_j}$$ are the basis polynomials. For example, $$L_0(x)=\dfrac{x(x-1)(x-2)}{(-1)(-1-1)(-1-2)}.$$ Similarly find $L_1(x), L_2(x), L_3(x)$ and then calculate $P_3(x)$.