A piecewise-defined function is a function whose domain is divided into parts and each part is defined by a different function rule.
The piecewise function with which you are probably most familiar is the absolute value function.
Example 1:
Graph the function.


Example 2:
Graph the function.

When would we use piecewise-defined functions in the “real world”? One example is postage rates, which increase in several steps, depending upon the weight of the package. Another example is telephone rates, which typically drop after a certain time at night.