If $f(x)=f(x')$ implies $G(x)=G(x')$ then $G(x)=h(f(x))$ for some function $h$ Suppose I have two functions $f$ and $G$ defined on the same domain $X$. Suppose that whenever $f(x)=f(x')$ for any $x,x'\in X$, we have $G(x)=G(x')$. Then, it's intuitive that knowing $f(x)$ amounts to knowing $G(x)$ so $G$ depends on $x$ only via $f(x)$. But is it possible to demonstrate this more formally please? Thank you very much.
 A: I wonder if you find this acceptable. 
Define $h:f(X)\to G(X)$ as follows: if $y\in f(X)$, then $y=f(x)$ for some $x\in X$ and we define $h(y)=G(x)$. The function $h$ is well-defined because it is independent of the choice of $x$: if $x'$ is another element of $X$ such that $f(x')=y$, then $G(x)=G(x')$. More importantly, the function $h$ defined this way establishes the desired relationship $G=h\circ f$.
A: Not really, if you take $f$ to be any injective function on $X$, then by your property $G$ is also injective. That's all we can say, now $f$ could be having nothing in common with (that is, no relation to) $G$, and hence, we cannot say $G$ is dependent on $f$ in any way. As an explicit counterexample suppose,
$$f : \mathbb{R} \to \mathbb{R}, \text{ defined by }, f(x) = \begin{cases}
0 & x \in [-1,1] \\
x^3 & \text{elsewhere}
\end{cases}$$
and $$G : \mathbb{R} \to \mathbb{R}, \text{ defined by }, G(x) = \begin{cases}
0 & x \in [-2,2] \\
100x^5 + \sin x & \text{elsewhere}
\end{cases}$$
Then, $f$ and $G$ satisfy the aforesaid properties, that is $f(x) = f(x') \implies G(x) = G(x')$, though they don't have anything else in common among them.
On the other hand, if given any $f$ and $G$, we are asked to find a map $h : f(X) \to G(X)$ such that $G = h \circ f$, then we can do this by defining $h$ by $h(f(x)) := G(x)$ where $x \in X$, then $f(x_1) = f(x_2) \implies G(x_1) = G(x_2)$ and hence this definition of $h$ would be our required composition.
A: Hint: define the equivalence relation
$$x\approx x'\iff f(x)=f(x')$$
and use the canonical bijection
$$\bar f:X/\approx\longrightarrow f(X).$$
