First find the inverses of f and g. An example would be useful. Let f(x)=3x+2 and g(x)=x^2.
Let y=f(a)=g(b). We want to find a and b. The inverse of f(x) is found by putting y=f(x): x=a=(y-2)/3 and x=b=√y. Now y is the domain. For the whole domain of y (the common domain for both inverse functions), we can find pairs (a,b). In the example, the domain of y is restricted to y≥0. There is a pair (a,b) for every positive (including zero) value of y. When y=0, for instance, a=-2/3 and b=0 so we have the pair (-2/3,0); when y=1 we have (-1/3,1); when y=2 we have (0,√2), and so on. We can therefore define two functions a(x) and b(x):
a(x)=f^-1(x) and b(x)=g^-1(x) for the general case. So using your example: 4=f^-1(20) and 9=g^-1(20). The pairs are (a(x),b(x)). The domain of x is the common domain for a(x) and b(x). If there is no common domain, then a and b cannot exist as a pair.