Show $f(x)$ doesn't have any local maximizers or minimizers

For real numbers $a,b,c,d$, define $\mathcal{O}=\{x\vert cx+d\neq 0\}$. Then define $$f(x)=\frac{ax+b}{cx+d}\;\;\text{for all x\in\mathcal{O}}$$ Show that if $f:\mathcal{O}\rightarrow\mathbb{R}$ is not constant, then it fails to have any local maximizers or minimizers.

For this question, it seems easier to use contradiction.

Assume that $f:\mathcal{O}\rightarrow\mathbb{R}$ is a non constant function and has a local maximizer and a local minimizer, there exist an $x_1$ and an $x_2$ in $\mathcal{O}$ such that $f(x_1)$ is a local maximizer and $f(x_2)$ is a local minimizer. However, $f$ is not continuous at $x=-d/c$ since $x=-d/c$ is a critical point. The limit at $x=-d/c$ doesn't exist and $$\lim\limits_{x\rightarrow (\frac{-d}{c})^+} \frac{ax+b}{cx+d}=\pm\infty;\;\;\;\lim\limits_{x\rightarrow (\frac{-d}{c})^-} \frac{ax+b}{cx+d}=\pm\infty$$ As $x\in\mathcal{O}$ approaches to $x=-d/c$, $f(x)$ is either approaching to infinity or negative infinity. This contradicts with $f$ has $f(x_1)$ as a local maximizer and $f(x_2)$ as a local minimizer. Therefore, by contradiction.

Can someone check this solution right or not? And I want to know how to write a direct proof, can someone give me a hint or suggestion to do it? Thanks

• All you've said is that there is no local extrema 'near' $x = -d/c$. The contradiction you claim does not hold. For example, consider $f(x) = \frac{\ln{x}}{x}$ if $x>0$ and $-f(-x)$ if $x < 0$. This has both a local maximiser and a local minimiser, although it too shoots up to $\pm \infty$ at $0$. Nov 18 '15 at 2:49
• @stochasticboy321 I see. Could I show $f$ is strictly increasing and decreasing? Nov 18 '15 at 3:03

Hint: $f'(x)=\frac{ad-cb}{(cx+d)^2}$ with $x\in(-\infty,-d/c)\bigcup(-d/c,\infty)$