# Sets which are order-isomorphic to the (extended) rationals

Let $(S,<)$ be a totaly ordered set under the strict order relation $<$. Suppose that, for any $a,b\in S$, if $a<b$, then there exists $c\in S$ such that $a<c<b$. We also assume that $S$ is countable (countably infinite, for clarification). Is it true that $S$ is order-isomorphic to one of the following totally ordered sets: $\mathbb{Q}$, $\mathbb{Q}\cup\{-\infty\}$, $\mathbb{Q}\cup\{+\infty\}$, and $\mathbb{Q}\cup\{-\infty,+\infty\}$ (equipped with their natural total orders, of course)? If not, what is a counterexample?

An order isomorphism from a partially ordered set $(A,<)$ to another partially ordered set $(B,<)$ is a bijection $f:A\to B$ such that, for $x,y\in A$ with $x< y$, we have $f(x)<f(y)$. Two partially ordered sets are order-isomorphic if there exists an order isomorphism from one to the other. This question is inspired by Order preserving bijection from $\mathbb{Q}$ to $\mathbb{Q}\backslash\lbrace{0}\rbrace$ (I just saw that somebody had posted an answer to my question in this link).

It is well known that a countably infinite, dense linear order without endpoints (i.e. without greastest nor smallest element) is order-isomorphic to $\Bbb Q$ (see e.g. here). So we need to deal with cases with endpoints. They are all analoguous, so I'll only consider the case where minimal element exists, while maximal doesn't.
Let $(X,<)$ be a countably infinite dense linear order with $x$ minimal and without a maximal element. I claim that $(X\setminus\{x\},<)$ is dense without endpoints. It's clearly dense (we aren't removing anything from between any two elements) and has no greatest element. Suppose $x'$ is the least element in $X\setminus\{x\}$. Then we have $x<x'$, so by density there is $y$ with $x<y<x'$. But $y\in X\setminus\{x\}$, contradicting minimality of $x'$.It follows that $X\setminus\{x\}$ has no endpoints, hence is order-isomorphic to $\Bbb Q$, hence $(X,<)$ is order-isomorphic to $\Bbb Q$ with additional element smaller than all elements of $\Bbb Q$, i.e. with $\Bbb Q\cup\{-\infty\}$.
Yes, this is true. Any countable, dense linear order with no endpoints is order-isomorphic to $(\mathbb Q, <)$ see here. Now, if $(L, \prec)$ is a countable, dense linear order, remove its endpoints (if there are any). Let $(L^*, \prec \restriction L^*)$ be the resulting countable, dense linear order without endpoints and pick an isomorphism $f^* \colon (L^*, \prec \restriction L^*) \to (\mathbb Q, <)$. Let $l$ be the left endpoint of $(L, \prec)$ and $r$ be the right endpoint of $(L, \prec)$ (if they exist). Extend $f^*$ by $f(l) = -\infty$ and $f(r) = \infty$. Then $f$ is your desired isomorphism.