Proving that a function is bijective I have trouble figuring out this problem:
Prove that the function $f: [0,\infty)\rightarrow[0,\infty)$ defined by $f(x)=\frac{x^2}{2x+1}$ is a bijection. 
Work: First, I tried to show that $f$ is injective. $\frac{a^2}{2a+1}=\frac{b^2}{2b+1}$
I got $a^2(2b+1)=b^2(2a+1)$. However, I get stuck here and cannot simplify the equation to get $a=b$, which would prove that the function is injective. 
 A: Notice $f(x) = \frac{x^2}{2x+1} = \frac{x}{2 + \frac{1}{x}}$. Suppose $f(a) = f(b) $, then
$$ \frac{a}{2 + \frac{1}{a} } = \frac{b}{2 + \frac{1}{b}} \iff \frac{a}{b} = \frac{ 2 + \frac{1}{a}}{2 + \frac{1}{b}}$$
We want to show that $a = b$. Suppose not. then either $a > b $ or $b >a $. 
Say $a > b $. Then $\frac{1}{b} > \frac{1}{a}$. and so
$$ \frac{a}{b} = \frac{ 2 + \frac{1}{a}}{2 + \frac{1}{b}} < \frac{ 2 + \frac{1}{b}}{2 + \frac{1}{b}} = 1 \implies a < b \; \; \text{contradiction} $$
Now, say $b > a $. then $\frac{1}{a} > \frac{1}{b} \implies \frac{1}{a} + 2 > \frac{1}{b} + 2 \implies \frac{ 2 + \frac{1}{a}}{2 + \frac{1}{b}} > 1 \implies \frac{a}{b} > 1 \implies a > b $ contradiction. Hence
$a= b$ and $f$ must be injective.
A: You have
$$
a^2(2b+1)=b^2(2a+1)
$$
that can be written as
$$
2a^2b-2ab^2=b^2-a^2
$$
or
$$
2ab(a-b)=-(a+b)(a-b).
$$
If $a-b\ne0$, you get
$$
a+b+2ab=0
$$
Is this possible?
For surjectivity, given $y\ge 0$, you have to solve the equation
$$
x^2=2xy+y
$$
or
$$x^2-2xy-y=0$$
with respect to $x$. It has one and only one non negative solution. Why?
A: One way to prove injectiveness in this case, is to prove that the function is strictly increasing. This can be done via derivative.
A: Incresing: $f'(x)=\frac{2x(2x+1)-2x^2}{(2x+1)^2}=\frac{2x^2+2x}{(2x+1)^2}\gt 0$, if $x\ne0$ thus f is strictly increasing. and thus is injective, now we need to show surjectivity.
Pick $y\in[0,\infty)$, if $f(x)=y\Rightarrow \frac{x^2}{2x+1}=y\Rightarrow x^2-2xy-y=0$
Thus by the quadratic formula $x=\frac{2y\pm\sqrt{4y^2+4y}}{2}\in [0,\infty)$, thus $f$ is also surjective.
(note that we only take the "+" root)
