the domain is the set in which all of the input of the function is constrained to fall. This is denoted by x, generally. On the other hand, the range are the set of output values and is denoted with the variable y.
Then, the domain is
and the range is
A function is a relation between two sets that associates each element of the domain set to exactly one element of the range set. We can visualize it, in our case, as
and we can see that for each element in the domain set correpond one each element in the range set. Then, Is the relation a function? YES