To find out if a graph shows a function, apply the Vertical Line Test.
Imagine a vertical line moving from left to right through the entire width of the graph. If in any position the line is, the vertical line only intersects one point of the graph at a time, the graph shows a function. If in any position of the vertical line, the vertical line intersects two or more points on the graph, then it is not a function.
A. The graph shows a vertical line. As the vertical line from the test goes from left to right, it first touches no points on the graph. When the vertical line coincides with the graph, and it touches every point points on the graph at the same time. That means that a vertical line is not a function.
B. The vertical line starts at the left touching nothing. As the vertical line gets to x = -1, it touches one point on the graph. As the vertical line keeps moving to the right of x = -1, it will touch two points in every position you put it in. This graph is not a function.
C. A vertical line starting from the left touches only one point on the graph up to x = -1. From x = -1 to x = 1, the vertical line touches two points on the graph. This is not a function.
D. The graph shows a horizontal line. A vertical line in any position will touch exactly one point in each position. This graph is a function.
Answer: D.