The relation is a function if each input (x) has only one output (y)
To check the graph of the function draw a vertical line in different positions, if it cuts the graph in more than 1 point, or passes through more than 1 point, then the graph does not represent a function
Let us do that with each graph
Graph 1:
The vertical line will pass through the 3 points at x = 2, then
Graph 1 is not a function
Graph 2:
The vertical line will pass through 1 point only in every position, then
Graph 2 is a function
Graph 3:
The vertical line will pass through 2 points at x = 1 and x = 2, then
Graph 3 is not a function