Whether or not a function is one-to-one can depend on its domain.
For example, f(x)=sin(x) is not one-to-one if the domain is R but is one-to-one if the domain is −/2 ≤ x ≤ /2.
Is f(x) = x2 one-to-one? (answer)