Let $\Bbb Z$ be the set of integers with the topology $\mathscr T_{\Bbb Z} = \{U_x \mid x \in \Bbb R\}$ where $U_x := \{z \in \Bbb Z \mid z > x\}$.
Let $\sim$ be a equivalence relation such that $x \sim y \iff x^2 = y^2$ , $\Bbb Z/_\sim$ the quotient space and $\pi:\Bbb Z \longmapsto \Bbb Z /_\sim$ the quotient-projection.
I have to understand the structure of $\Bbb Z /_\sim$ and tell if it is compact.
I suppose that $\Bbb Z /_\sim$ is homeomorphic to $\Bbb N$ and then I started searching for a homeomorphism between $\Bbb Z /_\sim$ and $\Bbb N$. I believe that this function is $h: \Bbb Z /_\sim\rightarrow \Bbb N \quad [z] \longmapsto |z|$ where $[z]$ is the equivalence class of $z$. Now I need to understand what kind of topology have $\Bbb Z /_\sim$.
Suppose $A$ is an non-empty open set of $\Bbb Z /_\sim$ such that $A \neq \Bbb Z /_\sim$. There is $[p] \in A$. Suppose that $p > 0$; since $A$ is open $\iff B := \pi^{-1}(A)$ is open we have that $p,-p \in B$ and $B = U_x$ with $x<-p$. Let $q > |x|$: of course $q \in U_x$ hence $[q] \in A$. But if $[q] \in A$ then $-q \in B$ and that is absurd so $\mathscr T_{\Bbb Z /_\sim} = \{\emptyset,\Bbb Z /_\sim\}$. Since $\Bbb Z /_\sim$ has the trivial topology it is compact.
My question is, how can I know what topology $\Bbb N$ have? I can choose it just to make my function $h$ an homeomorphism? Are there any errors in my reasoning? Thank you in advance.
Your reasoning is correct, and the quotient space has the trivial topology. There are of course many possible topologies on the natural numbers. However, the most natural way (I think at least) to think of the natural numbers is that they sit inside $\mathbb{R}$, as a subset. There is a standard topology on $\mathbb{R }$, which induces a standard topology (the subspace topology) on the subset $\mathbb{N}$.
This subspace topology on the naturals is the discrete topology, since for each natural number we can find a small open interval in the reals containing it and no other naturals. This is intuitive since you probably think of the naturals as a set of lone points which are entirely disconnected, i.e. discrete.
So in a way, your quotient space is topologically as different from the natural numbers as a countable space can be - the trivial topology being the coarsest and the discrete topology the finest.