The line $x =-1$ is assymptote, in that case we must have:
$$\lim_{x\to -1}\frac{ax+b}{x+c}=\pm\infty$$
I've written $\pm$ because any of them is valid. This is just abuse of notation to make this a little faster. For this to happen we need a zero in the denominator at $x=-1$ since this is just a rational function. In that case we want $c=1$.
The line $y = -2$ is assymptote, so that we have:
$$\lim_{x\to +\infty}\frac{ax+b}{x+c}=-2$$
In that case, our strategy is to calculate the limit and equal it to this value. To compute the limit we do as follows:
$$\lim_{x\to +\infty}\frac{ax+b}{x+c}=\lim_{x\to\infty}\frac{a+\frac{b}{x}}{1+\frac{c}{x}}=a$$
This implies that $a = -2$. Finally, since the curve passes through $(3,0)$ we have (I'll already plug in $a$ and $c$):
$$\frac{-2\cdot3+b}{3+1}=0$$
This implies that $b=6$. So the function you want is $f : \Bbb R \setminus \{1\} \to \Bbb R$ given by:
$$f(x)=\frac{-2x+6}{x+1}$$