# Need help understanding onto function

Let function $g$ from $V = \{1,2,3,4\}$ into V be defined by: $g(n)=3$.

I'm having trouble understanding why $g$ is not onto. I understand why it is not one-to-one but, since all the $y$ in $Y$, are mapped at least one $x$ in $X$ such that f(x) = y, wouldn't the function be onto?

• What is the mysterious $X$? – awllower Jan 27 '15 at 4:32
• For surjective functions, all the $x \in X$ need not be mapped from.. – mattos Jan 27 '15 at 4:32
• It is impossible to say whether or not $g$ is onto unless you clearly state the domain and codomain of $g$. – David Jan 27 '15 at 4:36
• @David Wouldn't the domain be 1,2,3,4 and the codomain be 3 for this case? – xxyyzz Jan 27 '15 at 4:37
• @Mattos Fixed my post. – xxyyzz Jan 27 '15 at 4:37

So $g$ is a function from $V$ to $V$. To say that $g$ is onto means:
for every $y$ in the codomain, there exists $x$ in the domain such that $y=f(x)$.
for every $y$ in $V$, there exists $x$ in $V$ such that $y=f(x)$.
This is not true because $f(x)$ is always $3$; so, if we take for example $y=1$, we find that there is no $x\in V$ such that $y=f(x)$.