<s>[INST] 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
 [/INST] 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.
</s>