To find the equation for each linear part of the graph, you will need to use two points from which to find the slope. Once the slope is determined, it can be used along with either of the two points to find the y-intercept. An equation of the form y = mx + b must be found.
The endpoints of each interval can be part of the domain of either function, as long as they are only included in one of the intervals.