Okay so for the first graph it is a function. You can tell by putting several lines through it vertically(top to bottom) and seeing how many times each line pass through the graph. When they each pass through 1 time then it’s a function. When -2 is put in the y output is 4, when 1 is put in the output is 1 and when 2 is put in the output is 4 again.
For the second graph it is not a function because when you put the vertical lines in the ones to the right of the y line go through 2-3 times. When you put -3 in you get an output of 1, 1 in gets you an output of 2, and 3 in gets you an output of 3 & 4.
Hope this helps and ask any questions if you have any.