Answer
$f(x)=\left\{
\begin{array}{cc}
-3 & \quad x \leq 0 \\
-3x+3 & \quad x \gt 0
\end{array}
\right.$
Work Step by Step
Each piece of the function is linear.
When $x\leq0$, the graph is the line given by
$y=-3$.
When $x\gt0$, the graph is the line given by
$y=mx+b$ where slope
$m=\frac{-3-0}{2-1}=-3$ and
y-intercept $b=3$.
$\implies y=-3x+3$
So, a piecewise function for the graph is
$f(x)=\left\{
\begin{array}{cc}
-3 & \quad x \leq 0 \\
-3x+3 & \quad x \gt 0
\end{array}
\right.$