Define onto functions Im struggling with an intuitive understanding of onto functions.  I understand one-to-one.
Can anyone give me an example? Looking for out-of-textbook thinking. :)
 A: Let $P$ be a set of (different) presents, and let $K$ be a set of kids.
You can think of a function $f:P \to K$ as a way of distributing all the presents among the kids. (We say that $f(x)=y$ if present $x$ was given to kid $y$.)
The function $f$ is onto if every kid gets at least one present.
The function $f$ is one to one if no kid gets $2$ or more presents. (Some kids might get none.)
For a picture, let the presents be represented by blue dots, and the kids by red dots. We specify a function (present distribution) by drawing an arrow from each blue dot to a kid. A function is onto if every kid is at the tip of some arrow, possibly more than one arrow. A function is one to one if two different arrows never end up at the same kid.  
A: A function $f:A\to B$ is onto if its image is equal to $B$, that is, $\operatorname{Im}(f)=B$.
For example, $f:\{0,1\}\to \{3,4\}$ given by $f(x)=x+3$ is onto.
Remember that the image of a function $f:A\to B$ is $$\operatorname{Im}(f)=\{b\in B\mid \exists a\in A; f(a)=b\}.$$
A: A function $f$ going from a set $X$ to a set $Y$ is onto if and only if for every member $y$ of the set $Y$ there is some $x$ in the other set $X$ for which $f(x) = y$.
That is, $f$ doesn't miss out on any of the possible things in $Y$ that it could hit; it hits them all.
For example, suppose $f$ maps a list of your best friends $X=\{\text{John}, \text{Mary}, \text{Susan}, \text{Amit}, \text{Peter}\}$ to the country where each person lives in the set $Y=\{\text{Italy}, \text{France}, \text{US}, \text{UK}\}$. Then "$f$ is onto" means at least one of your friends lives in every country. For each country $y$ in the list, there is at least one friend $x$ living in that country.
Similarly, $f:\mathbb R \to \mathbb R$ defined by $f:x\mapsto x^2$ is not onto because nothing gets mapped to -1, but $g:x\mapsto x^3$ is onto, because the graph of $x^3$ stretches out to $\pm\infty$ in either directions.

By contrast, one-to-one means that no two $x$s get mapped to the same $y$. For every $y$, there is either 1 or 0 $x$ such that $f(x)=y$. In the language of the above examples:


*

*No two friends can be from the same country.

*$f:\mathbb R \to \mathbb R$ with $f:x\mapsto x^2$ is not one-to-one because $\pm 1\mapsto 1$.

*$f:\mathbb R \to \mathbb R$ with $f:x\mapsto x^3$ is one-to-one because $x_2^3=x_1^3 \implies x_1=x_2$.

A: A function relates members of one set X to members of a second set Y  by assigning each member of set X to a single member of Y.  However, this does not require that every member of Y has received an assignment.  A function which does have every member of Y receiving such an assignment is said to be "onto".  (I read from your comment that you already understand "one-to-one", which is the condition that any member of Y that has received an assignment has only one member of X assigned to it.)
As an example, $ \ y = x^3 \ $ assigns each value of $ \ x \ $ to just one value of $ \ y \ $ , so it is a one-to-one function.  For any real number $ \ y \ $ you choose, there is a value of $ \ x \ $ which when cubed produces that value of $ \  y \ $ , so this function is also onto.  (This is the same as saying that every real number has a cube-root.)  By contrast, $ \ y = x^2 \ $ is neither one-to-one nor onto, since almost every value of $ \ y \ $ is produced by two values of $ \ x \ $ (except zero) [so it is almost always "two-to-one"], and this function cannot produce negative values [and so is not onto for real numbers].
A: A function has a domain, the set of possible inputs, and a codomain, the set of possible outputs.  "Onto" means that every possible output is actually produced by some input.

For example, let us consider the function $M$ that takes each person $p$ to their mother, and let's say that the codomain is the set of all women.  Then this is not an onto function, because not every woman is someone's mother.

There is a  subtle point here: When we think of a function, we don't just think about what it does.  We also think of its domain and codomain.  Consider a function  that takes a real number $x$ to its square $x^2$.  But actually there are several such functions, all a little different:  One is the function considered as a map from real numbers to real numbers.  The other is the function considered as a map from real numbers to non-negative real numbers.  The first of these is not onto, since its codomain includes $-1$, which is not the square of any real number.  The second one is onto; every non-negative real number is the square of some number in the domain.  Even though the functions do the same thing, they are considered different functions for this purpose.

For any function $f$, with given domain codomain $C$, we can find a function $g$ that does the same thing as $f$, on the same domain, but with a suitably restricted codomain, so that $g$ is onto.  
In the example about people's mothers, we said that $M$ was the function whose domain is all people, and whose codomain is all women, and this is not an onto function because not every woman is someone's mother.  If we were to consider instead the related function whose codomain is the set of all mothers, instead of all women, this function is onto. 
