Prove that $\mathbb{Z}$ is homeomorphic to $\mathbb{N}$

So i will start by saying that i am using the discrete topology for $$\mathbb{Z}$$ and for $$\mathbb{N}$$

Defining the function.

$$f: (\mathbb{Z},\tau_1)\longrightarrow (\mathbb{N},\tau_2)$$

$$f(x) = \begin{cases} 2x &\quad\text{if}\ge0, & x \in \mathbb{Z} \\ -2x-1 &\quad\text{if}<0 \\ \end{cases}$$

the inverse would be:

$$f^{-1}(x) \begin{cases} y/2 &\quad\text{if y even}, & x \in \mathbb{N} \\ \frac{y+1}{2} &\quad\text{if y odd} \\ \end{cases}$$

im trying to use the fact - that in the discrete topologies all the subsets of $$\mathbb{Z}$$ and $$\mathbb{N}$$ are opened - to prove that $$f$$ is continuous. Can i do that? And can i prove that this function is bijective on this topology and about the inverse ?

sorry for any mistake, and any help or tip would be greatly appreciated

• You are correct: as far as the domain has discrete topology, the function is continuous. And the function you created is one to one. – Miles Zhou Oct 9 '18 at 2:53
• thanks a lot!!, still trying to do the intermediate steps that are only in my head hahaah – Saiten Oct 9 '18 at 2:54

Your function $$f$$ works, and your definition of the inverse shows that $$f$$ is a bijection.
You're left to show that $$f$$ and $$f^{-1}$$ are continuous - or equivalently that $$f$$ is continuous and open.
For example, to show $$f$$ is continuous, you need to show that the preimage of any open set is open. But in the discrete topology every set is open...