Embedding linear orders into the reals such that infima/suprema are preserved Let $(A,\leq^A)$ be a countable linear (or total) order. It is well-known that $(A,\leq^A)$ order-embeds into the rationals $(\mathbb Q,\leq)$.
What I am wondering is whether there also is an embedding of $(A,\leq^A)$ into the reals $(\mathbb R,\leq)$ such that, whenever the infima/suprema
$$\bigwedge_i a_{i}\text{ or }\bigvee_{i}b_i$$
exist in $(A,\leq^A)$, then these are preserved by the embedding.
I think this should be true and my proof would be akin to the embedding of $(A,\leq^A)$ into the rationals (for simplicity, I embed the order into the open unit interval): enumerate the elements of $A$ by $(a_n)_{n\in\mathbb N}$ and then define the mapping
$$q_0:a_0\mapsto 1/2$$
and from $q_n$, define
$$q_{n+1}:=q_n\cup\left(a_{n+1}\mapsto\frac{q_n(x)+q_n(y)}{2}\right)$$
where $x,y\in\mathrm{dom}(q_{n})=\{a_0,\dots,a_n\}$ are such that they fulfill
$$x<^Aa_{n+1}<^Ay$$
and $x$ is maximal with this property and $y$ minimal with this property in $\mathrm{dom}(q_n)$. The embedding $q$ is given by the union of all the $q_n$.
My question is whether the above is correct and whether there is maybe a simpler proof? Could it be possible to show that the completion of $(A,\leq^A)$ embeds into $(\mathbb R,\leq)$ while preserving infima/suprema (the completion of $(\mathbb Q,\leq)$)?
 A: Your proof isn't complete, since you haven't justified that $q$ in fact has the desired properties. At a glance I suspect that it (or rather, its modification to account for the case where $a_{n+1}>a_i$ for all $i\le n$ and similarly with $<$) does indeed work, but I also think it will be tedious to verify this.
To avoid doing work, here's another approach, which ultimately uses similar machinery but hides it "under the hood" via an application of Cantor's theorem:
First, we introduce a construction. For a linear order $S$, let $S'$ be the linear order gotten from $S$ by adding a new point $p$ between every pair of points $x,y\in S$ such that $y$ is the immediate successor of $x$ in $S$. We now have the following observation:

Suppose $X\subseteq S$ and $y\in S$ is the least upper bound of $X$ in $S$. Then $y$ remains the least upper bound of $X$ in $S'$.

Proof. There are two cases. If $X$ has a greatest element, that element must be $y$, and trivially $y$ will remain the greatest element of $X$ no matter how we add points to $S$. If $X$ does not have a greatest element, then every new point $a\in S'\setminus S$ which is $<y$ is also $<x$ for some $x\in X$, and so no point in $S'$ below $y$ is greater than every element of $X$. $\quad\Box$
The analogous result holds for infima:

Suppose $X\subseteq S$ and $y\in S$ is the greatest lower bound of $X$ in $S$. Then $y$ remains the greatest lower bound of $X$ in $S'$.

Using these facts, we can proceed as follows. Let $A$ be a countable linear order; WLOG $A$ is nonempty and without endpoints. Let $A_0=A$, and for $i\in\mathbb{N}$ let $A_{i+1}=A_i'$. Setting $B=\bigcup_{i\in\mathbb{N}} A_i$, we see that $B$ is a dense linear order without endpoints. Now fix an isomorphism $f:B\cong\mathbb{Q}$ and let $g=f\upharpoonright A_0$; $g$ is an embedding of $A$ into $\mathbb{Q}$, and by the facts above we have that $g$ preserves arbitrary sups and infs.
