Proving that a function is not injective. 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$?
 A: 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.
A: A counterexample suffices: $1 \neq -1$ but $f(1) = f(-1)= \frac12$ so $f$ is not injective. 
Also, $f(x)$ never assumes the value $0 \in \mathbb{R}$, so $f$ is not surjective, and moreover all $f(x) >0$, so all negative values are also never assumed.
$f$ would be bijective as a function from $(0,\infty) \to (0,1)$..
A: Look at $f(1)=f(-1)$. These are the same, therefore, f cannot be injective.
To prove it is not surjective, try to find an x such that $f(x)>1$, say 2. Then f(x)=2 means solving $x^2=-1/2$ which has no real solution.
A: It would be easier to just demonstrate that there is some element $y$ in $\mathbb R$ such that $f(x)\neq y$ for all $x\in \mathbb R$, and also find two numbers $x_1\neq x_2$ such that $f(x_1)=f(x_2)$. 
Could you do this for the function $x\mapsto x^2$ (just think of the graph)? If so the how about for the function $x\mapsto x^2+1$? What about the function $x\mapsto 1/x$? Moving from these functions to $f$ should then be fairly simple.
A: I'm assuming your proof is something like:
Let $f(a) = f(b)$ so 
$\frac 1{a^2 +1} = \frac 1{b^2 + 1}$ 
.....
$a^2 = b^2$ 
so $\pm a = \pm b$,
and you are asking if that completes the proof.
Well, not really but mostly, in my opinion.  You need to explicitely state $a \ne b$ IS a possibility.  "$\pm a = \pm b$" seems as though you are solving an equation and have found multiple pontential solutions but nothing definite.  We aren't actually trying to solve something but prove that something could definite happen.
So if you concluded with the statement:
"and so if $b = -a \ne a$ we'd have a case where $f(a) = f(b)$ but $a \ne b$"
then it would be adequate, in my opinion.
.....
However I also think it'd be more direct to simply say from the start:
For any $a \ne 0$ then $a \ne -a$.  But $f(a) = f(-a)$ so $f$ is not injective.
....
or as others have pointed out a single specific counter example would do.
