Lillybeth
I think you may be getting a little confused because these problems involve finite domains. (Have you discussed the domain of a function. The domain of a function is the set of input values for which the function is defined.) In one problem, the function was defined using coordinate notation such as
\(\displaystyle (1, 2),\ (2, 4),\ (3, 6).\)
In a different problem, the function was defined using a tabular form
\(\displaystyle x\ \ y\)
\(\displaystyle 1\ \ 2\)
\(\displaystyle 2\ \ 4\)
\(\displaystyle 3\ \ 6\)
As srmichael has said, a function must produce as output exactly ONE value for every input value in the function's domain. Determining whether something is a function when the purported domain is infinite may call for a bit of conceptual work because you cannot individually test every item in the domain.
But when the domain of the purported function is finite, as it is in these problems, the determination is super easy. I suspect that you are thinking of these problems as implying infinite domains and wondering how you determine anything about them from a small set of examples. But these problems do not involve infinite domains; nothing is told to you about input values other than what you see. They are finite domains.
For a function to be defined for a finite set of input (frequently labeled as x) values, you must have: (1) an output value (frequently labeled as y) for every input value, and (2) either (a) each possible input value is listed just once, or (b) any repeated input value shows the same output value each time.
Do you see why the procedure above conforms to srmichael's general definition?