Injectivity and surjectivity of a function with constants I have the function $$f(x)=\frac{a}{x}-\frac{b}{x^2}$$
how can I prove/disprove that it's injective and surjective over $\mathbb{R}$ for all $a$ and $b$?
Edit: Someone at another forum suggested that I use $$x=\frac{2b}{a\pm 2bc}$$
to prove that it's not injective, and it works! However, I do not know how he arrived to said solution in the first place.

First, suppose $b=0$. Then the function is not surjective since $f(x)=a/x\neq0$ for all $x$. It is however injective if $a\neq0$.
Now suppose $b\neq0$. Solve the equation $f(x)=y$ for $y\neq0$:
$$
x=\frac{a\pm\sqrt{a^2-4by}}{2y}
$$
The only way that $f$ is injective is that $\sqrt{a^2-4by}=0$ so that we get only one value for $x$. But there are obviously values of $y$ for which $\sqrt{a^2-4by}\neq0$. So $f$ is not injective if $b\neq0$. Similarly, there are many values of $y$ for which $a^2-4by<0$ so there are no solutions for $x$. Hence, if $b\neq0$, then $f$ is not surjective.
So it is never surjective, and it is injective if and only if $b=0$ and $a\neq0$.
