Is it a function why or why not ??

it is a function because each input (x) has a unique output (y) that is not repeated
In order for a relationship between numbers x and y to be considered a function from x to y, you need to have one unique y for every x. This doesn’t mean that each y needs exactly one x; for instance, the function y = x² is a function from x to y and has two y values associated with most x values (x = 2 and x = -2, for instance, both give you y = 4).
Essentially, if we give a function some x value, we want to know exactly what y value we’re getting out of it.
The pictured table gives you two possible values for x = 2; given a 2 as input, we have no idea whether to go to 1 or 7 for our output, so it would not be a function from x to y.
(Interestingly, a function from y to x would satisfy that “one output per input” requirement, so if you wanted to impress your teacher, you could answer “yes, but only from y to x, NOT x to y”)