This question was asked in Example 11

 f from R to R given by f(x) =|x| is niether one one nor onto

Asha K's image