Consider the following function defined in parts:
$$ f(x)=\Bigg\lbrace \begin{eqnarray} x+2 & \mbox{si} & x\leq 0 \\\\ 2 & \mbox{si} & 0 < x \leq 2 \\\\ x+4 & \mbox{si} & x>2 \end{eqnarray}$$
Do the graphic representation.
See development and solution
Development:
We may realize that:

In the interval $$(\infty, 0]$$ we have a straight line of slope $$m = 1$$ and that cuts the axis $$x$$ in $$x =2$$.

In the interval $$(0, 2]$$, we have a constant function $$y = 2$$.
 In the interval $$(2, +\infty)$$ we have a straight line of slope $$m =1$$ and that cuts the axis $$x$$ in $$x = 4$$.
Therefore the graph of the function is: