it is surjective - $f: \mathbb{N} \rightarrow \mathbb{N}: x \rightarrow 2x$

i think, this function is surjective:
$$f: \mathbb{N} \rightarrow \mathbb{N}: x \rightarrow 2x$$

but in my textbook it says, it is not surjective. but no proof there. i am really wondering if it is a mistake. because for all $y\in\mathbb{N}$ it is true that $f^{-1}\{y\}\neq \emptyset$. for example: $2,4,6,8,10,12,..$ for $y$ there are $1,2,3,4,5,6..$ for $x$.

am i missing here something or what is happening here which makes this not surjective? thanks for help.

-
What do you think is a preimage of $1$? – Chris Eagle Feb 2 '13 at 12:36
well, $1$ is outside of function definition, because $y$ is $2x$, isnot it? – doniyor Feb 2 '13 at 12:37
This function is injective, not surjective. The function definition is $f:\mathbb{N}\to\mathbb{N}$, not $f:\mathbb{N}\to2\mathbb{N}$ – CBenni Feb 2 '13 at 12:38
@Cbenni, yeahh, now i got it. so i should look at domain and co-domain to see if EVERY element from these domains are hit, right? – doniyor Feb 2 '13 at 12:42
@Cbenni, exactly that was my problem. now i got it. great help. Thanks a lot – doniyor Feb 2 '13 at 12:44

A function $f:X\to Y$ is surjective if for every $y\in Y$ there is some $x\in X$ such that $f(x)=y$. Here, there is no natural number that is mapped to $1$.

Your confusion might have arisen because you have mixed up the expression for the image of the function ($2x$) with the codomain ($N$).

-
yeah Jason, exactly, that was my problem. thank you – doniyor Feb 2 '13 at 12:43

Recall that $f\colon A\to B$ is surjective if and only if for every $b\in B$ there is some $a\in A$ such that $f(a)=b$.

In our case, $f(n)\neq 1$ for all $n$, because $1$ is not an even integer and cannot be written as $2k$ for some $k\in\mathbb N$. Therefore $f$ is not surjective because the codomain is $\mathbb N$, and $1\in\mathbb N$.

-
Thanks Asaf, now i got it – doniyor Feb 2 '13 at 12:45

You say that $f^{-1}(\{y\})\not=\varnothing$ for all $y\in\mathbb{N}$, but what is $$f^{-1}(\{1\})\text{,}$$ since the set $f(\mathbb{N})$ is constituted entirely in even numbers ?

However, note that the same function, but defined on $\mathbb{Q}\to\mathbb{Q}$ is surjective. This is probably what misled you.

-
Thanks Klaus, great, – doniyor Feb 2 '13 at 12:45