Here we don't have any repeated x values.
In choice A, x = 2 repeats. In other words, x = 2 leads to multiple y outputs. So this is not a function. Choices B and D are similar stories. A function is only possible if every x leads to exactly one y value only. The graph must pass the vertical line test.
Side note: the y values can repeat, but the function won't be one-to-one.