# Domain of the identity function after inverse composition

Hi, I'm struggling to understand something. Does domain restriction work the same way for composition of inverse functions as it does for other composite functions? I would assume it does, but the end result seems counter-intuitive. For example:

If I have the function f(x) = 1/(1+x), with the domain restriction x > 0 and
g(x) = (1-x)/x, with the domain restriction 0 < x < 1 ....

Then these functions are inverses. If I compose them to test this, then of course, I get the identity function in both cases....but do I need to specify a domain restriction on f(g(x)) and g(f(x))? I believe, that if I do so, then the domain of both composites should be 0 < x < 1. Firstly, am I correct, and secondly, what does this actually mean....in terms of the functions being inverses? If we were to graph the composites, would we just have a line segment? If the answer is yes, does this have any affect on the inverses operation upon each other?

Thanks for any help or insight anyone can give, or any other similar examples I could investigate.

fresh_42
Mentor
A function can only be applied where it is defined. So ##f \circ g## is only defined on ##(0,1]## and ##g \circ f## is only defined on ##[0,\infty)##. If - as in your example - all domains are subsets of one common space and ## f\, : \,A \rightarrow f(A)## and ##g\, : \,B \rightarrow g(B)## then ##f \circ g## is defined on ##B## and ##g \circ f## is defined on ##A##. However, there can be further restrictions to the codomains, as ##f## is restricted to ##g(B) \cap A## in the composition ##f \circ g## and ##g## is restricted to ##f(A) \cap B## in the composition ##g \circ f##. In your example we had ##f(A)=B## and ##g(B)=A##, so no further restrictions to the compositions.

The simple rule is, that all steps have to be defined.

Thank you very much. The precalculus book I'm using doesn't explain this question of the composition of domains very clearly. So, just to make sure I understand, the domain of f ° g in my example would be (0,1] and of g ° f would be [0, ∞). (I know that's how you prefaced your explanation, forgive me, I'm just a sucker for certainty.)

Is there any geometric/graphical application of this fact that I should be aware of that I may be missing? Or perhaps a geometric explanation of the same reality?