A function gives every element of its domain exactly one image. Range = the set of images actually produced, always a subset of the codomain.
To test a relation, check each domain element once: exactly one image each. Shared images and unused codomain elements are allowed. Substitute with brackets when evaluating f at a negative number or an expression. Find the range by listing the images, and do not confuse it with the codomain.