A cubic function can be written as
y = a(x - x1)(x - x2)(x - x3),
where x1, x2, and x3 are the zeros, or where the function hits the x-axis (y = 0), and a determines how a function is stretched, and how the cubic will behave at very high and low values of x. This is almost the same as a quadratic, except one more root is added.
We are given 3 coordinates with a y = 0, and the x-coordinates of these are -2, 0, and 1. This follows the definition of a "zero" in the above paragraph, so substitute these into the cubic function and we get
y = a(x - 0)(x + 2)(x - 1) = a*x(x + 2)(x - 1).
To determine the value of a, plug in the last remaining coordinate (-1, 2) into the equation:
2 = a(-1)(-1 + 2)(-1 - 1) = a(-1)(1)(-2) = 2a
⇒ a = 2/2 = 1
So, our final function is
y = x(x + 2)(x - 1).
If you want to write this in standard form, expand the above equation to get
y = x3 + x2 - 2x (Both forms are correct).