Is $g : \mathbb R →\mathbb R$, $g(x) = |x|$ one-to-one and onto? So, here is my function, in which I am to prove or disprove both if it is onto and one-to-one:
Deﬁne $g : \mathbb R →\mathbb R$ by $g(x) = |x|$.
For onto, can I say that it is not, because if we take any negative number such as $x = -1$, we get the positive value of that number in the image, which means that all the negative numbers in the codomain are not matched to an element in the domain?
For one-to-one, can't I say that it isn't there will be two elements in the domain that point to the same element in the codomain?

Yes, you can. It's best to give an explicit example, too; you should describe two particular numbers $a\neq b$ such that $g(a)=g(b)$.
