# Existence of a homeomorphism between two subspaces of real line

Can we say the set of natural numbers is homeomorphic to the set of integers? A map $f$ from $N$ to $Z$ defined $f(n)=-n$ does not work. Could you give me any hint?

-
Are you looking for a bijection or a homeomorphism? If the latter, you need to specify a topology of sorts... –  copper.hat Oct 29 '12 at 2:55

HINT: Any bijection works, since both sets have the discrete topology. Try matching up the even natural numbers with the non-negative integers and the odd natural numbers with the negative integers, for instance.

-
there exists no odd natural numbers? what do you mean? –  ege Oct 29 '12 at 3:02
Some natural numbers are very odd... –  copper.hat Oct 29 '12 at 3:04
@ege: Of course there are odd natural numbers: I even mentioned them! You want a bijection from $\Bbb N$ to $\Bbb Z$; I’m suggesting that you try to find one that sends every even natural number to a non-negative integer and every odd natural number to a negative integer. Look at $0,1,2,3,4,5,\dots$ and $0,-1,1,-2,2,-3,\dots$ for more inspiration. –  Brian M. Scott Oct 29 '12 at 3:04
what about the set of rationals? Is it homeomorphic to the set of integers? –  ege Oct 29 '12 at 3:15
@ege: Definitely not. $\Bbb N$ is discrete: every singleton $\{n\}$ is an open set. Is $\{q\}$ ever an open subset of $\Bbb Q$? –  Brian M. Scott Oct 29 '12 at 3:24

Hint: Natural numbers can be even or odd. Integers can be positive or negative.

-
sorry because of the misunterstanding. thanks, now its clear. –  ege Oct 29 '12 at 3:07

Try $\phi(n) = (-1)^n \lfloor \frac{n}{2} \rfloor$. Then $\phi:\mathbb{N} \to \mathbb{Z}$ is a bijection.

-