You can consider the digit expansion for example but in $\Bbb R$, it's not trivial to formalise since $0.\overline{9}=1$. So I'll take integers but the idea remains the same.
$f:\begin{array}{l}\Bbb N \times \Bbb N \to \Bbb N\\(x,y)=\left(\sum\limits_{k=0}^{+\infty}x_k10^k,\sum\limits_{k=0}^{+\infty}y_k10^k\right)\mapsto \sum\limits_{k=0}^{+\infty}x_k10^{2k}+y_k10^{2k+1}\end{array}$
The idea is that you take all the digits and then put one from $x$, then one from $y$ (and you fill the blanks with $0$s) untill you have used all the digits of both numbers. So you easily get that
$f^{-1}:\begin{array}{l} \Bbb N \to \Bbb N \times \Bbb N\\x=\sum\limits_{k=0}^{+\infty}x_k10^k\mapsto \left(\sum\limits_{k=0}^{+\infty}x_{2k}10^k,\sum\limits_{k=0}^{+\infty}x_{2k+1k}10^k\right)\end{array}$
Regarding your comment:
You have $f_1:S \times T \to S$ and $f_2:S \times T \to A$ and you want $f_3:S \to A$ so that $f_2 = f_3 \circ f_1$ or $f_4:T \times S$ so that $f_2=(s,t)\mapsto f_4(t,f_1(s,t))$.
A sufficient condition for $f_3$ to exist would be $f_1$ injective. If you think of your machine as a graph, that would mean you never have two arrows pointing to the same state. This condition is not necessary because if $f_2$ is a constant, we can take $f_3=f_2$ even if $f_1$ isn't injective.
An necessary and sufficient condition for $f_3$ to exist is $\forall (x,y)\in (S \times T)^2,f_1(x)=f_1(y)\implies f_2(x)=f_2(y)$. In the previous sufficient but not necessary condition we used $\forall (x,y)\in (S \times T)^2,f_1(x)=f_1(y)\implies x = y \implies f_2(x)=f_2(y)$ which implies our necessary and sufficient (that is, equivalent) condition by transitivity of $\implies$.
The existance if basically the same thing except that we replace injectivity on $S \times T$, by injectivity with respect to the first variable on $S$ for all $t\in T$ which is a strictly weaker proposition.