The two "pieces" of $f(x)$ are pleasantly smooth. The only potential source of problems is at $x=-1$, where the pieces join up nicely, we hope.
So first of all, $f(x)$ must be continuous at $-1$. This will be the case if the limit of $ax+b$, as $x$ approaches $-1$ from the right, is the same as the limit of $bx^2-3$, as $x$ approaches $-1$ from the left.
That comes down to saying that $-a+b=b-3$. We conclude that for continuity of $f(x)$ at $x=-1$, we must have $a=3$.
But continuity does not imply differentiability: the two pieces of $f(x)$ must not only join up nicely, they must join up without a "kink." We can make sure of this by making sure that the limit of the slope of $ax+b$, as $x$ approaches $-1$ from the right, matches the limit of the slope of $bx^2-3$, as $x$ approaches $-1$ from the left.
The slope of $ax+b$ is always $a$, that is, always $3$. So we want the slope of $bx^2-3$ to approach $3$ as $x$ approaches $-1$ from the left.
The derivative of $bx^2-3$ at $x$ is $2bx$, which approaches $-2b$ as $x$ approaches $-1$ from the left. So we want $-2b=3$.
Another approach is to imagine two full curves, $y=p(x)=ax+b$ and $y=q(x)=bx^2-3$. We want to be able to travel rightward along $y=bx^2-3$ and then at $x=-1$ smoothly enter the curve $y=ax+b$, without jump or bump. That means that (i) The functions must match at $-1$, so $p(-1)=q(-1)$ and (ii) Their derivatives match at $-1$, so p'(-1)=q'(-1). The rest of the calculation is the same as in the first version of the solution.
Comment: In computer graphics, simple functions defined over shortish intervals are used to produce more complex shapes. For the simple functions, cubics are often good enough, one might even try for quadratics. Then we have to make sure that the cubic or quadratic pieces join up smoothly. Certainly we want continuity at the joins, but also differentiability, and preferably twice differentiability. For more information about this, one keyword is splines.