In general, given a function h(x), a horizontal shift of h(x) is given by the transformation below
[tex]\begin{gathered} h(x)\rightarrow h(x-a) \\ a>0\rightarrow\text{ a units to the right} \\ a<0\rightarrow\text{ a units to the left} \end{gathered}[/tex]Then, in our case,
[tex]g(x)=f(x-3)=(x-3)^2+5(x-3)-1[/tex]Simplifying,
[tex]\begin{gathered} \Rightarrow g(x)=(x^2-6x+9)+5x-15-1=x^2-x-7 \\ \Rightarrow g(x)=x^2-x-7 \end{gathered}[/tex]