which graph represents a function of x

Answer:
The answer is D. because it passes the vertical line test.