For a relation to be a function, each x-coordinate can appear only once.
If you have more than one ordered pair with the same x-coordinate, the relation is not a function.
One way to determine whether or not it is a function is to use the vertical line test.
Imagine a vertical line moving from left to right. If the vertical line intersects at most one point of the graph in any position it is, the graph is a function.
As the vertical line goes from x = -4 to just before x = -1, it only intersects on point at a time. At x = -1, y = 1, the solid dot, so at x = -1, the vertical line also only intersects one point. Then the vertical line goes from x = -1 to just left of x = 1. Again, it passes the vertical line. At x = 1, y is not equal to 1 or to 2 since those points have open dots. At x = 1, y is only -2. The vertical line only intersects one point at x = 1. From x = 1 to past x = 4, the relation also passes the vertical line test.
The graph of the function passes the vertical line test everywhere, so the relation in the graph is a function.