Prove the cardinality of $\mathbb{Z}$ and $\mathbb{N}$ is the same.
For the cardinality to be the same, there must exists a bijective function $f:\mathbb{N}\mapsto\mathbb{Z}$. If there exists a bijective function, then there exists an inverse $g:\mathbb{Z}\mapsto\mathbb{N}$ of it.
Suppose there exists such function. Then if $n\in\mathbb{N}$ and $z\in\mathbb{Z}$,
\begin{align} (g\circ f)(n)&=n\\ g(f(n))&=n\\ g(z)&=n\\ f(g(z))&=f(n)\\ z&=f(n)\\ f(n)&=f(n)\\ f(n)-f(n)&=0\\ 0&=0 \end{align}
Clearly this is true, so there exists such bijective function. Which means $\mathbb{Z}$ and $\mathbb{N}$ have the same cardinality.
But I feel this is incorrect, because if instead of $\mathbb{Z}$ and $\mathbb{N}$ I have to prove the equality of the cardianilites of $\mathbb{Z}$ and $\mathbb{R}$, the conclusion would be the same, but clearly this is not true.