Answer
a) Shift to the right by $5$ units, shift up by $2$ units.
b) Shift to the left by $1$ unit, shift down by $1$ unit
Work Step by Step
$a.$
Since $y=f(x-5)+2$, we start with the graph of $f(x)$ and
- shift it to the right by $5$ units ... to get $f(x-5)$,
- and raise it up by $2$ units ... to get $f(x-5)+2$.
$b.$
Since $y=f(x+1)-1$, we start with the graph of $f(x)$ and
- shift it to the left by $1$ unit ... to get $f(x+1)$.
- and lower it up by $1$ unit ... to get $f(x+1)-1$.