Determine if these functions are injective 
Determine if the following functions are injective.
$$f(x) = \frac{x}{1+x^2}$$
$$g(x) = \frac{x^2}{1+x^2}$$

My answer:
$f(x) = f(y)$
$$\implies \frac{x}{1+x^2} = \frac{y}{1+y^2}$$
$$\implies x+xy^2 =y+yx^2$$
$$\implies x=y$$
Hence $f(x)$ is injective
$g(x) = g(y)$
$$\implies \frac{x^2}{1+x^2}=\frac{y^2}{1+y^2}$$
$$\implies x^2+x^2y^2=y^2+y^2x^2$$
$$\implies x^2=y^2$$
$$\implies \pm x=\pm y$$
So $g(x)$ is not injective
 A: If $x + xy^2 = y+yx^2$, then $(x - y) = yx^2 - xy^2 = xy(x-y)$.  This gives $(x-y)(xy-1) = 0$, hence either $x=y$ or $xy=1$. You can check that for example, $f(\frac 12) = f(2) = \frac 25$.
Hence, $f$ is not injective.
The answer to the second question is correct.
A: Let $x \neq 0$
$$f\left(\frac1x\right)=\frac{1/x}{1+1/x^2}=\frac{x}{1+x^2}=f(x)$$
Thus, $f$ is not injective. Your mistake was $x+xy^2=y+yx^2 \implies x=y$. This is certainly not true.
$$g(-2)=\frac{(-2)^2}{1+(-2)^2}=\frac{4}{1+4}=g(2)$$
Hence, $g$ is not injective.
A: Where you had $x+xy^2=y+yx^2,$ you canceled $xy^2$ from one side and $yx^2$ from the other side, but those are not the same.
But the equation can be written as $yx^2 - (y^2+1) x + y = 0,$ and that is $ax^2+bx+c=0,$ where $a=y,$ $b=-(y^2+1),$ and $c=y.$
The solution for $x$ of the equation $ax^2+bx+c=0$ is $x = \dfrac{-b\pm\sqrt{b^2-4ac\ {}}}{2a}.$
So you have $x = \dfrac{y^2+1 \pm \sqrt{(y^2+1)^2 - 4y^2}}{2y} = \dfrac{y^2+1 \pm (y^2-1)}{2y} = \Big( \dfrac 1 y \text{ or } y \Big).$
Since there are two solutions, this is not one-to-one.
