Answer
$$f(x)=\left\{\begin{array}{ll}
-x & x\leq0 \\
-x+2 & 0 \leq x\leq2
\end{array}\right.$$
(Other answers are also possible.)
Work Step by Step
As depicted in the graph, the left hand side of the graph represents a line with a slope of $-1$ and $y$-intercept of $0$.
We can also conclude from the right side of the graph that it represents a line with a slope of $0 $ and $y$-intercept of $2$.
Therefore, the definition for this function can be expressed as:
$$f(x)=\left\{\begin{array}{ll}
-x & x\leq0 \\
-x+2 & 0 \leq x\leq2
\end{array}\right.$$