It takes me pretty much time come up with this proof. Does it look fine or contain logical flaws? Thank you for your help!
Let $(P, <)$ be a dense linearly ordered set without endpoints. Then there exists a complete linearly ordered set $(C,\prec)$ such that
$P\subseteq C$.
If $p,q\in P$ then $p < q$ if and only if $p \prec q$ ($<$ coincides with $\prec$ on $P$).
$P$ is dense in $C$, i.e., for any $a,b\in C$ such that $a\prec b$, there is $p\in P$ with $a\prec p \prec b$.
$C$ does not have endpoints.
The linearly ordered set $(C,\prec)$ is called the completion of $(P, <)$.
My attempt:
A Dedekind cut of $(P, <)$ is a pair $(A, B)$ such that
$A\neq \emptyset$ and $B\neq \emptyset$.
$A\cap B=\emptyset$ and $A\cup B=P$.
If $a \in A$ and $b \in B$, then $a < b$.
$A$ does not have a greatest element.
Let $\mathfrak C$ be the sets of all Dedekind cuts of $(P, <)$. We define an order $\prec$ on $\mathfrak C$ by $$(A_1,B_1) \prec (A_2,B_2) \iff A_1 \subsetneq A_2$$
$\prec$ is a linear order on $\mathfrak C$
For $(A_1,B_1),(A_2,B_2),(A_3,B_3)\in \mathfrak C$:
Either $(A_1,B_1) \preccurlyeq (A_2,B_2)$ or $(A_2,B_2) \preccurlyeq (A_1,B_1)$. If not, $A_1 \not \subseteq A_2$ and $A_2 \not \subseteq A_1 \implies \exists a'\in A_1: a'\notin A_2$ and $\exists a''\in A_2: a''\notin A_1 \implies \exists a'\in A_1: a'\in B_2$ and $\exists a''\in A_2: a''\in B_1 \implies a'\in A_1,a''\in B_1$ and $a''\in A_2, a'\in B_2 \implies a'<a''$ and $a''<a'$ by the fact that $(A_1,B_1),(A_2,B_2)$ are Dedekind cuts of $(P, <)$. This is clearly a contradiction. Thus either $(A_1,B_1) \preccurlyeq (A_2,B_2)$ or $(A_2,B_2) \preccurlyeq (A_1,B_1)$. Hence $\prec$ is connex.
If $(A_1,B_1) \preccurlyeq (A_2,B_2)$ and $(A_2,B_2) \preccurlyeq (A_1,B_1)$, $A_1 \subseteq A_2$ and $A_2 \subseteq A_1 \implies A_1=A_2 \implies (A_1,B_1) = (A_2,B_2)$. Hence $\prec$ is antisymmetric.
If $(A_1,B_1) \preccurlyeq (A_2,B_2)$ and $(A_2,B_2) \preccurlyeq (A_3,B_3)$, $A_1 \subseteq A_2$ and $A_2 \subseteq A_3 \implies A_1 \subseteq A_3$ $\implies (A_1,B_1) \preccurlyeq (A_3,B_3)$. Hence $\prec$ is transitive.
For $p\in P$, let $\underline p=\{x\in P\mid x<p\}$ and $\overline p=\{x\in P\mid p\le x\}$.
$(\underline p,\overline p)$ is a Dedekind cut of $(P, <)$ for all $p\in P$
For any $p\in P$, there exist $p_1,p_2$ such that $p_1<p<p_2$ by the fact that $P$ has no endpoints $ \implies p_1 \in \{x\in P\mid x < p\}$ and $p_2 \in \{x\in P\mid p \le x\} \implies p_1 \in \underline p$ and $p_2 \in \overline p \implies \underline p\neq\emptyset$ and $\overline p\neq\emptyset$ for all $p\in P$.
It's clear that $\underline p \cap \overline p=\emptyset$ and that $\underline p \cup \overline p=P$.
If $a\in \underline p$ and $b\in \overline p$, $a<p$ and $p\le b \implies a<p\le b \implies a<b$.
Since $\underline p=\{x\in P\mid x<p\}$, $\underline p$ does not have a greatest element. If not, assume $m$ is a greatest element of $\underline p$. Then $m\in \underline p$ and thus $m <p$. Since $P$ is dense, there is $p'\in P$ such that $m < p' <p$. Then $p'\in \underline p$ and $m<p'$. This clearly contradicts the fact that $m$ is a greatest element of $\underline p$. Hence $p$ does not have a greatest element.
Let $\mathfrak B=\{(\underline p,\overline p) \mid p \in P\}$. Then $\mathfrak B \subseteq \mathfrak C$. We define a mapping $f:P \to \mathfrak B$ by $f(p)=(\underline p,\overline p)$.
$f$ is an order isomorphism between $(P,<)$ and $(\mathfrak B,\prec)$
For $(\underline p,\overline p) \in \mathfrak B$, it's trivial that $f(p)=(\underline p,\overline p)$. Thus $f$ is surjective.
For $p_1,p_2 \in P$ and $p_1<p_2$, $\{x\in P\mid x<p_1\} \subsetneq \{x\in P\mid x<p_2\} \implies \underline {p_1} \subsetneq \underline {p_2}$ $\implies (\underline {p_1},\overline {p_1}) \prec (\underline {p_2},\overline {p_2})$. Hence $f(p_1) \prec f(p_2)$.
Thus $(P,<)$ and $(\mathfrak B,\prec)$ are order-isomorphic.
We next prove that $\mathfrak C$ is a completion of $\mathfrak B$.
$\mathfrak B$ is dense in $\mathfrak C$
For $(A_1,B_1),(A_2,B_2) \in \mathfrak C$ and $(A_1,B_1)\prec(A_2,B_2)$, then $A_1 \subsetneq A_2$, and thus there exists $p_1 \in A_2$ and $p_1 \notin A_1$. It follows that $p_1 \in A_2$ and $p_1 \in B_1$.
$A_2$ does not have a greatest element $\implies$ there exists $p_3 \in A_2$ such that $p_1 < p_3$. $p_1\in B_1$ and $p_1 < p_3 \implies p_3 \in B_1$. If not, $p_3 \notin B_1 \implies p_3 \in A_1 \implies p_3 < p_1$ by the fact that $p_1 \in B_1$. This clearly contradicts the fact that $p_1 < p_3$. Thus $p_3\in A_2$ and $p_3 \in B_1$.
$p_1 < p_3$ and $p_1,p_3\in A_2$ and $p_1,p_3\in B_1 \implies$ there exists $p_2$ such that $p_1 <p_2< p_3$ and $p_2\in A_2$ and $p_2\in B_1$.
$p_1<p_2$ and $p_1,p_2\in B_1\implies A_1 \subseteq \{x\in P\mid x<p_1\} \subsetneq \{x\in P\mid x<p_2\}$ $\implies A_1 \subsetneq \{x\in P\mid x<p_2\} \implies A_1 \subsetneq \underline p_2 \implies (A_1,B_1) \prec (\underline {p_2},\overline {p_2})$.
$p_2<p_3$ and $p_2,p_3\in A_2\implies \{x\in P\mid x<p_2\} \subsetneq \{x\in P\mid x<p_3\} \subseteq A_2$ $\implies \{x\in P\mid x<p_2\} \subsetneq A_2 \implies \underline {p_2} \subsetneq A_2 \implies (\underline {p_2},\overline {p_2}) \prec (A_2,B_2)$.
To sum up, there exists $(\underline {p_2},\overline {p_2}) \in \mathfrak B$ such that $(A_1,B_1) \prec (\underline {p_2},\overline {p_2}) \prec (A_2,B_2)$. Hence $\mathfrak B$ is dense in $\mathfrak C$.
$\mathfrak C$ does not have endpoints
For any $(A,B)\in \mathfrak C$: $P$ has no endpoints $\implies$ there exists $p_1,p_2\in A$ such that $p_1<p_2 \implies$ $\{x\in P\mid x<p_1\} \subsetneq \{x\in P\mid x<p_2\} \subseteq A \implies \{x\in P\mid x<p_1\} \subsetneq A \implies \underline {p_1} \subsetneq A \implies$ $(\underline {p_1},\overline {p_1}) \prec (A,B)$. Hence $\mathfrak C$ does not have a least element.
For any $(A,B)\in \mathfrak C$: $P$ has no endpoints $\implies$ there exists $p_1,p_2\in B$ such that $p_1<p_2 \implies$ $A \subseteq \{x\in P\mid x<p_1\} \subsetneq \{x\in P\mid x<p_2\} \implies A \subsetneq \{x\in P\mid x<p_2\} \implies A \subsetneq \underline {p_2}$ $\implies (A,B) \prec (\underline {p_2},\overline {p_2})$. Hence $\mathfrak C$ does not have a greatest element.
To sum up, $\mathfrak C$ does not have endpoints.
$\mathfrak C$ is complete
Suppose that $S$ is a nonempty subset of $\mathfrak C$ and is bounded above by $(A_0,B_0)$. Let $A_s=\bigcup\{A\mid (A,B)\in S\}$ and $B_s=\bigcap\{B\mid (A,B)\in S\}$.
Notice that $S$ is bounded above by $(A_0,B_0)$ $\implies A\subseteq A_0$ for all $(A,B)\in S \implies P\setminus A_0 \subseteq P\setminus A$ for all $(A,B)\in S \implies B_0 \subseteq B$ for all $(A,B)\in S \implies B_0 \subseteq B_s$.
First, we prove that $(A_s,B_s)$ is a Dedekind cut of $(P,<)$ and thus is an element of $\mathfrak C$.
$A \neq \emptyset$ for all $(A,B)\in S \implies \bigcup\{A\mid (A,B)\in S\} \neq \emptyset \implies A_s \neq \emptyset$. Furthermore, $\emptyset \neq B_0 \subseteq B_s \implies B_s \neq \emptyset$.
If $A_s\cap B_s \neq \emptyset$, there exists $x\in A_s$ and $x\in B_s$ $\implies \exists (A',B')\in S:x\in A'$ and $\forall (A,B)\in S:x\in B \implies x\in A'$ and $x\in B' \implies x\in A'\cap B'=\emptyset$. This is clearly a contradiction. Thus $A_s\cap B_s = \emptyset$. Moreover, $A_s\cup B_s=(\bigcup\{A\mid (A,B)\in S\}) \bigcup (\bigcap\{B\mid (A,B)\in S\})=(\bigcup\{A\mid (A,B)\in S\}) \bigcup (\bigcap\{P\setminus A\mid (A,B)\in S\})=(\bigcup\{A\mid (A,B)\in S\}) \bigcup (P\setminus\bigcup\{ A\mid (A,B)\in S\})=P$. Thus $A_s\cup B_s=P$.
If $a\in A_s$ and $b\in B_s$, $\exists (A',B')\in S:a\in A'$ and $\forall (A,B)\in S:b\in B \implies a\in A'$ and $b\in B' \implies a<b$.
For all $(A,B)\in S:A$ does not have a greatest element $\implies \bigcup\{A\mid (A,B)\in S\}$ does not have a greatest element $\implies A_s$ does not have a greatest element.
To sum up, $(A_s,B_s)$ is a Dedekind cut of $(P,<)$ and thus is an element of $\mathfrak C$.
Next we prove $(A_s,B_s)$ is the supremum of $S$.
$A_s=\bigcup\{A\mid (A,B)\in S\} \implies A\subseteq A_s$ for all $(A,B)\in S \implies (A,B) \preccurlyeq (A_s,B_s)$ for all $(A,B)\in S \implies (A_s,B_s)$ is an upper bound of $S$.
If $(A',B')$ is another upper bound of $S$, $A\subseteq A'$ for all $(A,B)\in S \implies \bigcup\{A\mid (A,B)\in S\} \subseteq A' \implies A_s \subseteq A' \implies (A_s,B_s) \preccurlyeq A',B')$.
Finally, we define a completion of $P$.
I claim that $P \cap \mathfrak C=\emptyset$. If not, there exists $p\in P$ and $p\in \mathfrak C \implies p=(A,B)\in P$ where $(A,B)$ is a Dedekind cut $\implies (A,B)\in A\cup B$. If $(A,B)\in A$, $A\in\{A\}\in (A,B)\in A$. If $(A,B)\in B$, $B\in \{A,B\}\in (A,B)\in B$. Both cases lead to the contradiction to Axiom of Foundation. Thus $P \cap \mathfrak C=\emptyset$.
Let $\mathfrak D=(\mathfrak C \setminus \mathfrak B) \cup P$. We define a mapping $g:\mathfrak D \to \mathfrak C$ by
$$g(x)=\begin{cases} f(x) & x\in P \\ x & x\notin P \end{cases}$$
We define an order $\prec'$ on $\mathfrak D$ by $$\text{ For }x,y\in \mathfrak D: x \prec' y \iff g(x) \prec g(y)$$
$g$ is an order isomorphism between $\mathfrak D$ and $\mathfrak C$
It's clear from the definition of $g$ that $g=f\bigcup \operatorname{id}_{ \mathfrak C \setminus \mathfrak B}$ in which $f$ and $\operatorname{id}_{ \mathfrak C \setminus \mathfrak B}$ are bijective, their domains are disjoint, and so are their ranges. Thus $g$ is bijective.
It follows directly from the definition of $\prec'$ that for $x,y\in \mathfrak D: x \prec' y \iff g(x) \prec g(y)$.
$(\mathfrak D,\prec')$ is a completion of $(P,<)$
$g$ is an order isomorphism between $\mathfrak D$ and $\mathfrak C$, and $\mathfrak C$ is complete linearly ordered $\implies \mathfrak D$ is complete linearly ordered.
$g$ is an order isomorphism between $\mathfrak D$ and $\mathfrak C$, and $\mathfrak C$ does not have endpoints $\implies \mathfrak D$ does not have endpoints.
$\mathfrak D=(\mathfrak C \setminus \mathfrak B) \cup P \implies P\subseteq \mathfrak D$.
For $p,q\in P$: $p<q \iff f(p) \prec f(q)$ by the fact that $f$ is an order isomorphism between $(P,<)$ and $(\mathfrak B,\prec) \iff g(p) \prec'g(q)$ by the definition of $g$. Thus $p<q \iff g(p) \prec' g(q)$.
For any $x,y \in \mathfrak D$ such that $x \prec' y:g(x) \prec g(y)$ by the fact that $g$ is an order isomorphism between $\mathfrak D$ and $\mathfrak C$. Moreover, $\mathfrak B$ is dense in $\mathfrak C \implies$ there exists $b\in \mathfrak B$ such that $g(x) \prec b \prec g(y) \iff x \prec' g^{-1}(b) \prec' y$ by the fact that $g$ is an order isomorphism between $\mathfrak D$ and $\mathfrak C$. Notice that $b\in \mathfrak B \implies g^{-1}(b)=f^{-1}(b) \in P$. As a result, for any $x,y \in \mathfrak D$ such that $x \prec' y$, there is $p\in P$ such that $x \prec' p=g^{-1}(b) \prec' y$. Hence $P$ is dense in $\mathfrak D$. This completes the proof.