Starting from geometric axioms, it is indeed quite demanding to construct a correspondence from a line to the real numbers. I will assume Hilbert's axioms and sketch how it is usually done. In fact I will use one-dimensional axioms only.
Let $L$ be a geometric line together with the betweenness relation $B$ and congruence relation $\equiv$ satisfying all the axioms.
The key point in the reasoning is proving the existence of segment measure. A function $\mu\colon L\times L\rightarrow [0,\infty)$ is called a measure, whenever the following hold:
- $\mu(ab)=0 \iff a=b$.
- $ab\equiv a'b' \implies \mu(ab)=\mu(a'b')$.
- $B(abc) \implies \mu(ab)+\mu(bc)=\mu(ac)$.
To construct the measure we take the following steps:
- Consider the family of all free segments, i.e. the equivalence classes of the congruence relation.
- Define multiplication of a free segment by a positive real number, which we do successively from natural and rational numbers.
- Prove that for any two free segments, one is the product of the other and a unique real positive number.
- Fix one segment that will serve as a unit and express any other segment as a multiple of the unit one.
- Assign this value to any free segment and carry it to the points on the line.
Once the measure is constructed, we can pick a point $o\in L$ together with a ray originating at $o$ and define
$$\xi(p):=\begin{cases}\mu(op) & , p\in A\\ -\mu(op) & , p\in A^*.\end{cases}$$
Then $\xi\colon L\rightarrow \mathbb R$ is the desired correspondence function.