So, here is my function, in which I am to prove or disprove both if it is onto and one-to-one:
Define $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?