This is a piece wise function. A piece wise function has 2 or more functions which only work on specific intervals. To find when x = -2, first find the interval that contains x = -2.
The interval is x < 0. This interval corresponds to the function x².