Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose $f$ and $g$ are such that $f(g(x)) = 1$. Does this imply that $g(f(x))$ is constant?

share|cite|improve this question
Although this is a question that doesn't require calculus, I think we can get some additional insight by applying the chain rule to $f(g(x))$ and $g(f(x))$. The chain rule tells us that the product of $f'$ and $g'$ is zero, which is the same condition regardless of the order of composition. One derivative or the other must be zero. This is why most functions you write down will satisfy the conjecture. The reason it can fail is that in the two cases, we could be sampling the derivatives in different regions of their domains. – Ben Crowell Oct 29 '12 at 20:33
up vote 12 down vote accepted


$$f(x) = \begin{cases} 1 & x \geq 0 \\ 0 & x < 0 \end{cases}$$

$$g(x) = x^2, \,\,\, \forall x \in \mathbb{R}$$

We then have $$f(g(x)) = f(x^2) = 1, \,\,\,\, \forall x \in \mathbb{R}$$ whereas $$g(f(x)) = f(x)^2 = \begin{cases} 1 & x \geq 0 \\ 0 & x < 0 \end{cases}$$

share|cite|improve this answer
Just nitpicking. $f(g(x)) = 0$ in your example. – Makoto Kato Oct 29 '12 at 19:53
@MakotoKato Yes. I was changing that. Thanks. – user17762 Oct 29 '12 at 19:53

No, $\forall x \in I$ and $I' = f^{-1}(1) $ \ $ g(x)$ $$f(g(x)) = 1$$ $$f(g(f(x))) = 1$$ $$g(f(x)) \in f^{-1}(1) = g(x) \cup I'$$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.