A function is a relationship between two sets of values (usually called input and output) that associates the first value to the second.
The domain of a function of input values for which the function is valid.
The range is the set of output values brought about by the set of inputs.
Given:
The domain is the set of the values of x in this equation for which our function f(x) is valid.
The range is the set of values of f(x) that can be obtained for these values of x.