Domain = {2, 3, 4}
Range = {20, 30, 40}
The domain is the set of all possible inputs. The range is the set of all possible outputs. For any set, each item is listed once so we'll toss any duplicates that may happen. The order of each set doesn't matter.
Because the input x = 2 leads to more than one output (y = 20 and y = 40 simultaneously), this means we do not have a function. A function is only possible if any given input in the domain leads to exactly one output in the range.