Why is $f(x) = |x|$ not surjective? Can anyone explain to me why the function
$$
f(x)=|x|
$$
is not surjective (onto)?
I think it should be, but my teacher told me it's not.

It depends on your definition of $f$. Consider $f : \mathbb R \to \mathbb R$ where $x \mapsto |x|$, this is certainly not surjective because every negative value $(-\infty, 0)$ is not mapped to by $f$. 
Whereas one could define $f : \mathbb R \to [0, \infty)$, which would be surjective, but not injective.
