Suppose that $(A,\leq)$ is a non-empty totally ordered set for which each non-empty subset has a least element and a greatest element. Show that there is a surjective mapping $f:\mathbb N\to A$ such that $f(m)\leq f(n)$ if $m\leq n$.
My attempt: For $a\in A$, let $U(a)=\{b\in A\mid a<b\}$ be the set of strictly upper bounds of $\{a\}$ in $A$. Let $x=\min A$ and $s(a)=\min U(a)$ if $U(a)\neq\varnothing$, and $s(a)=a$ otherwise. We define $f$ recursively as follows: $f(0)=x$ and $f(n+1)=s(f(n))$. It's easy to prove that $f$ is increasing.
Please check if the below part, in which I show $f$ is surjective, contains any error!
Assume that $f$ is not surjective, then $P=\{b\in A\mid b\notin\text{ran}f\}\neq\varnothing$. Let $p=\min P$, then $p\neq x=f(0)$. Let $p_0=\max\{b\in A\mid b<p\}$, then $p_0\in\text{ran}f$ and $p_0=f(k)$ for some $k\in\mathbb N$. So by definition of $f,f(k+1)=s(f(k))=s(p_0)=p$. Thus $p\in\text{ran}f$, which is a contradiction. So $f$ is surjective.
EDIT: on the basis of Cameron Buie's answer, I added this part for clarity.
- $p_0$ is well-defined
$p\neq x\implies x<p$ [Since $x=\min A$] $\implies x\in\{b\in A\mid b<p\}\implies\{b\in A\mid b<p\}\neq\varnothing$. Also, each non-empty subset of $A$ has a least element and a greatest element, then $p_0=\max\{b\in A\mid b<p\}$ does exists.
- $s(p_0)=p$
We have $p_0=\max\{b\in A\mid b<p\}$, then $p_0<p$ and $t<p\implies t\leq p_0$.
For all $k> p_0$, then either $k<p$ (this case is impossible. If not, $k<p\implies k\leq p_0\implies k\not >p_0$) or $k\geq p$. Thus $p_0<p$ and $p_0<k\implies p\leq k$. This implies $p=\min\{b\in A\mid p_0<b\}=\min U(p_0)=s(p_0)$. To sum up, $s(p_0)=p$.
It looks like you have the right idea! Formally, you should probably prove that $f$ is increasing (unless previous results justify it for you), rather than just saying it's easy to do. Also, you should probably justify that $p_0$ is defined and prove that $s(p_0)=p$ (unless previous results justify them for you), each of which is straightforward.