The proof asks for a function $f: \mathbb{R} \rightarrow \mathbb{R}$ given by $$f(x)=\frac{1}{x^2+1}$$ prove that it is neither injective nor surjective.
My thoughts are to approach this using a proof by contradiction, and say I will prove that the function is injective. I can get to the step where $a^2=b^2$ and I know the square root of a variable is $\pm$ that variable. So would my final step be to say that $\pm a \neq \pm b$?
The easiest way to prove that a function is not injective is to explicitly name distinct elements of the domain that map to the same place.
The easiest way to prove that a function is not surjective is to explicitly name an element of the codomain that is not mapped to.
In this case, $$f(1) = \frac{1}{1+1} = \frac{1}{2}\ \ \ \text{and} \ \ \ f(-1) = \frac{1}{1+1} = \frac{1}{2},$$ and there is no $x \in \mathbb{R}$ such that $$ \frac{1}{x^2 +1} = -5,$$ so $-5 \in \mathbb{R}$ is not mapped to.