Answer
$g(x)=\left\{
\begin{array}{cc}
3x+18,& \quad \text{if }x\lt -6\\
-3x-18, & \quad \text{if }x \geq -6
\end{array}
\right.$
Work Step by Step
The absolute value function $g(x)=a|x-h|+k$ can be written as a piecewise function.
$g(x)=\left\{
\begin{array}{cc}
a[-(x-h)]+k,& \quad \text{if }x-h\lt 0 \\
a(x-h)+k, & \quad \text{if }x-h \geq 0
\end{array}
\right.$
Given $y=g(x)=-3|x+6|$
$\implies a=-3, h=-6$ and $k=0$
Then, $g(x)$ as a piecewise function is
$g(x)=\left\{
\begin{array}{cc}
-3[-(x+6)]+0,& \quad \text{if }x+6\lt 0 \\
-3(x+6)+0, & \quad \text{if }x+6 \geq 0
\end{array}
\right.$
Simplifying, we get
$g(x)=\left\{
\begin{array}{cc}
3x+18,& \quad \text{if }x\lt -6\\
-3x-18, & \quad \text{if }x \geq -6
\end{array}
\right.$