I know that this is fairly standard and that there are many ways to do this. I want to understand here what is happening intuitively in Stromberg's proof of Theorem (1.55).
The proof is as follows.
Assume $\mathbb{N}$ is finite. Since $\mathbb{N}\neq \lbrace\rbrace$, there is a smallest $n$ such that $\mathbb{N}\sim \lbrace k\in\mathbb{N}: 1\leq k\leq n \rbrace$. Let $f:\lbrace k\in\mathbb{N}: 1\leq k\leq n \rbrace \rightarrow \mathbb{N}$ be one-to-one and onto. Now define $g:\lbrace k\in\mathbb{N}: 1\leq k\leq n-1 \rbrace \rightarrow \mathbb{N}$ by the rule \begin{equation}g(k) =\begin{cases} f(k),& \operatorname{if} f(k)<f(n)\\ f(k)-1,& \operatorname{if} f(k)>f(n).\end{cases}\end{equation} Then $g$ is one to one and onto $\mathbb{N}$. This contradicts the minimality of $\mathbb{N}$.
Formally, I understand all the arguments. Since $f$ is one to one and onto, one can check that $g$ is also one to one and onto. If this is the case, in particular the case that I don't understand, being $g$ onto means that for $n\in\mathbb{N}$, there is a $k\in \lbrace k\in\mathbb{N}: 1\leq k\leq n-1 \rbrace$ such that $g(k)=n$.
But what I can't see is how to propose a particular $f$ such that for, say, $n\in\mathbb{N},\;g(k)=n$. There's simply "not enough" elements in the domain of $g$ to do this (but it should be, since $g$ is onto).
Pick $m\in\mathbb N$. We must find $k$ with $1\le k\le n-1$ such that $g(k)=m$.
First, we are given that $f$ is onto, so there is $s$ with $1\le s\le n$ such that $f(s)=m$. If $m<f(n)$, then we could let $k=s$, so that $g(k)=g(s)=f(s)=m$ by definition of $g$, as long as $s<n$ (because then $1\le s\le n-1$ and $s$ is in the domain of $g$). Now, $s\ne n$ because $f(s)<f(n)$, so we are done with this case.
So we are left with the situation where $m\ge f(n)$. Since $f$ is onto, there is a $t$ with $1\le t\le n$ such that $f(t)=m+1$ (and note that $m+1>f(n)$). If $t<n$ then, by definition of $g$, we can take $k=t$: $g(k)=g(t)=f(t)-1=m$. Again, $t=n$ is impossible, this time because $f(t)>f(n)$.