1. The problem statement, all variables and given/known data Suppose g is a function with the property that g(x) =/= g(y) if x=/=y. Prove that there is a function f such that f( g(x) ) = x. (The composition) 2. Relevant equations Definition of a function, collection of ordered pairs; g(x) =/= g(y) if x=/=y; x → g(x) → x (The composition that has to be proven). 3. The attempt at a solution Since all g(x) are actually unique, that means there is a function f whose domain is a collection of all g(x) and that assigns the value x to all g(x), so that f is a collection of ordered pairs of the form (g(x), x). In other words, there is no contradiction from definition of a function, thus such a function does exist. My problem is that I am extremely careful with proofs and to be honest this "proof" of mine seems lazy and wrong and full of holes. The part where I assume that f can assign x to g(x) seems very sketchy. I also found out that this is somehow a proof that there is an inverse function f for function g, if g(x) are all unique. So I wonder if this is actually the right way of doing things, or did I miss sth crucial and my "proof" has bunch of holes in it or is it even plain miss from the start.