$\displaystyle f(x)=\begin{cases}x+7, & x\leq0 \\ -2x+5, & 0<x<3 \\ x-1, & 3\leq x \end{cases}$
Ask yourself, over what interval of values for $\displaystyle x$ is $\displaystyle f(x)\in[-5,-1]$?Determine the pre-image under f for each of the intervals
(i) [-5, -1]
$\displaystyle f(x) = x+7 = -5 \implies x=-12 \text{ and } f(x)=x+7=-1 \implies x=-8$
$\displaystyle f^{-1}\left([-5,-1]\right) = [-12,-8] $