Well ordering of $ \mathbb{R} $ of smallest order type I am attempting to solve the following problem:

There exists a function $ f: \mathbb{R} \rightarrow \mathbb{R} $ that is surjective on every open interval

I have done some research and I'm trying to understand this answer. The author mentions that, by choice, we can well-order the set $ X = \{(a,b,c) \in \mathbb{R}^3 : a < b\} $ in such a manner that every point has less-than-continuum predecessors (a well ordering of smallest possible order type). That's what I am having trouble understanding. Zernelo's theorem does provide us a well ordering of $ X $, but I can hardly understand why it would have such property.
I would appreciate some explanation
 A: This is an extension of the well-ordering theorem. Let L be any ordinal. Then consider the set of ordinals S onto which L bijects. S is nonempty, so has a least element T. Can you show that each element of T has fewer than T many predecessors?
A: Let $S$ be any set and let $\kappa$ be the cardinality of $S.$
Claim. The set $S$ admits a well-ordering in which each element has $\lt\kappa$ predecessors.
Proof. Let $\lt$ be any well-ordering of $S.$ If each element of $S$ has $\lt\kappa$ predecessors, we are done. Otherwise, the set
$$A=\{a\in S:a\text{ has }\kappa\text{ predecessors}\}$$
is nonempty. Let $a_0$ be the least element of $A$ and let
$$S'=\{a\in S:a\lt a_o\}.$$
Then $S'$ is a well-ordered set of cardinality $\kappa$ with the property that each ot its elements has $\lt\kappa$ predecessors. Since $|S|=|S'|,$ we can use a bijection between $S$ and $S'$ to define an ordering of $S$ with the same property.
Of course this argument uses the axiom of choice. However, no choice is needed to construct a real function which is surjective on each interval. Without using the axiom of choice, you can construct a sequence of pairwise disjoint Cantor sets, so that every rational interval contains one of them; and you can define a function $f:\mathbb R\to\mathbb R$ which is surjective on each of those Cantor sets.
A: You can think about it in analogy with countable ordinals.  If you have a countable ordinal, say $\omega^2 + \omega2+87$, the initial $\omega$ of the order has every element with only finitely many predecessors.  Similarly if you have a well order of cardinality $\mathfrak c$, the initial $\mathfrak c$ elements will have less than $\mathfrak c$ predecessors.  As your set $X$ has cardinality $\mathfrak c$ you can biject it with this order.
A: My guess is that you know about well-ordered sets but not ordinal numbers.  For a brief introduction to the latter, see e.g. here.  The gist of it is that any set of well-ordered sets is itself well-ordered under the relation "$A$ is an initial segment of $B$".
Thus, among all ordinals of a given cardinality $\kappa$, there is a smallest one...which in fact is often taken to be the definition of $\kappa$.  This smallest ordinal has the property that any initial segment in $\kappa$ is a smaller ordinal, so by definition has cardinality less than $\kappa$.  Applying this with $\kappa = 2^{\aleph_0}$, the cardinality of the continuum, gives what you want.
