Answer
The necessary and sufficient condition to guarantee invertibility is $ad-bc \neq 0$.
Work Step by Step
The function $f$ is invertible if and only if it is one-to-one, by Theorem 0.4.3. Assume $x_1, x_2$, are real numbers such that $f(x_1) = f(x_2)$. Writing this in terms of $a,b,c,d$ yields
$$\frac{ax_1+b}{cx_1+d} = \frac{ax_2+b}{cx_2+d}.$$
Cross multiplying, one obtains
$$(ax_1+b)(cx_2+d) = (ax_2+b)(cx_1+d).$$
Expanding both sides yields
$$acx_1x_2 + adx_1 + bcx_2 + bd = acx_2x_1 + adx_2 + bcx_1 + bd.$$
Cancelling common terms from both sides and rearranging leaves us with
$$(ad - bc)(x_1 - x_2) = 0. \tag{$\star$}$$
Therefore, $f(x_1) = f(x_2)$ is equivalent to $(\star)$. The condition that $f$ is invertible therefore is
$$(ad - bc)(x_1 - x_2) = 0 \implies x_1 = x_2,$$
which is equivalent to having $ad-bc \neq 0$.