Suppose $f(x) = x$ when $x < 0$ ; $f(x) = -x +1$ when $ 0 < x \le 2$, and $f(x) =1$ otherwise.

Draw a mapping diagram and graph of $f$ yourself, or consider the GeoGebra figures and table below.

Martin Flashman, Dec. 20, 2013, Created with GeoGebra

Notice how the points on the graph are paired with the points on the mapping diagram.Given a point / number, $x$, on the source line, there is a unique arrow meeting the target line at the point / number, $f(x)$. which corresponds to the function's value for $x$

Check the box to see more points and arrows corresponding to data on the table.

When the point $x$ in the domain is $( -\infty,9) $, the arrow points to $f (x)= x$, while when $x$ is in the interval $[0,2)$ the arrow points to $ f(x)=-x+1$ on the target axis, and otherwise the arrow points to $f(x) =1$. Notice also the "steps" on the graph at $(0,1)$ and $(2,1)$ which are points where the graph is disconnected.

The function is increasing for the interval $(-\infty,0)$, but decreasing for the interval $[0,2)$ and constant on the interval $[2,\infty)$.

You can check this by moving $x$ on the mapping diagram.

You can change the function and the values of $a$ and $b$ where the "steps" occur to explore this further.