If I understand you right, you want to find an $f$ such that $\forall x,y\in\mathbb R,n,m\in\mathbb N: g(f(x),n)=g(f(y),m)\Rightarrow x=y$ And furthermore, given the value of $g(f(x),n)$ there should be an effective procedure for finding $x$. True?
I think it is somewhat easier to think in terms of bit sequences than real numbers here, so let's assume that $f$ takes $2^\omega$ (the set of infinite sequences of bits) to $2^\omega$ and $g$ just chops off the first $n$ bits in a sequence. This is equivalent to your formulation, if only we take a bit of care not to run into trouble with sequences that end in repeating $1$s.
Here is one possible construction for $f$.
Take the input bit sequence and put $22$ in front of it. This results in another infinite sequence of the alphabet $\{0,1,2\}$. Call this sequence $a_1, a_2, a_3, \ldots$.
Interlace infinitely many copies of the $(a_i)$ sequence, like this:$\begin{array}{c} a_1 && a_2 && a_3 && a_4 && a_5 && a_6 \\ & a_1 &&&& a_2 &&&& a_3 \\ &&&a_1&&&&&&&&a_2 \\ &&&&&&& a_1 \\ \hline a_1 & a_1 & a_2 & a_1 & a_3 & a_2 & a_4 & a_1 & a_5 & a_3 & a_6 & a_2\end{array}$ Each copy is spaced out by a factor of $2^i$ for some i. The general rule is that the element number $2^i(2j-1)$ of the interlaced sequence is $a_j$.
Translate the interlaced sequence to a self-synchronizing binary sequence by the rule that $0$ becomes 0
, $1$ becomes 01
and $2$ becomes 011
.
To find $x$ given $g(f(x),n)$, translate back to an $\{0,1,2\}$-sequence and look for the first two $2$-symbols whose mutual distance is a power of $2$. These two $2$s must be the beginning of one of the copies of $(a_i)$, and now that you know where it begins and what its spacing is, you can read off all of the $(a_i)$ and reconstruct $x$.
Since the output sequence contains infinitely many zeroes and infinitely many ones, we don't get into any problems with real $c$ values that have two different binary represntations.