No.
The function y = x2, where the domain is the real numbers and the codomain is the non-negative reals is onto, but it is not one to one. With the exception of x = 0, it is 2-to-1.
Fact, they are completely independent of one another.
A function from set X to set Y is onto (or surjective) if everything in Y can be obtained by applying the function by an element of X
A function from set X to set Y is one-one (or injective) if no two elements of X are taken to the same element of Y when applied by the function.
Notes:
1. A function that is both onto and one-one (injective and surjective) is called bijective.
2. An injective function can be made bijective by changing the set Y to be the image of X under the function. Using this process, any function can be made to be surjective.
3. If the inverse of a surjective function is also a function, then it is bijective.