In the Space-Time diagram (in the rest frame) we often take the Space axis as the horizontal axis and the time axis as the axis perpendicular to it as in the given figure.

While there are other models to graphically represent space-time, my question is:
What function $f(x,y,z)$ on a $3$ dimensional surface can we define such that no two distinct points $(x_1,y_1,z_1)$ and $(x_2,y_2,z_2)$ shall have the same value?
i.e $f(x_1,y_1,z_1)=f(x_2,y_2,z_2)$ if and only if $x_1=x_2$, $y_1=y_2$ and $z_1=z_2$.
That way every point in the $X$ axis of the figure will represent a unique point in $3$-$D$ space.
Well, you can interleave the digits. That is, if the first value are $x$, represented in base 10 by digits $x_n x_{n-1} \dotsm x_2 x_1 x_0 . x_{-1} x_{-2} \dotsm$, and the other values $y$ and $z$ are similarly represented in base 10 by digits $y_i$ and $z_i$, then your output is $$ x_N y_N z_N x_{N-1} y_{N-1} z_{N-1} \dotsm x_0 y_0 z_0 . x_{-1} y_{-1} z_{-1} \dotsm $$ where $N$ is the maximum index required by $x$, $y$, or $z$ (pad out the other numbers by zeros.)
(You may use any base you please, of course, not just base 10.)
This is a 1-to-1 function, as you require, but it's probably not all that useful: you can't keep the features you expect from 3-dimensionality in a single real value.