Can you find two functions $f$ and $g$ such that they are not equal and $$f \circ g= f,\qquad\text{and}\qquad g \circ f= f$$ where $\circ$ denotes composition of the two functions.

  • $\begingroup$ If we work with only $f$ and $g$ which are invertible, then $g$ would be forced to be the identity map by some basic group theory. $\endgroup$
    – Tai
    Jul 24 '17 at 16:39
  • $\begingroup$ Can you give an example? $\endgroup$
    – Karan
    Jul 24 '17 at 16:44
  • $\begingroup$ You can let $f$ be anything, and it will work if you set $g(x) = x$ (the identity map) since $f(g(x)) = f(x) = g(f(x))$. In fact, if you restrict $f$ and $g$ to be invertible, then $g(x) = x$ will be the only function that will satisfy this. $\endgroup$
    – Tai
    Jul 24 '17 at 16:45
  • $\begingroup$ What is the domain of the two functions? Reals? Integers? Finite sets? $\endgroup$
    – Somos
    Jul 24 '17 at 17:58
  • $\begingroup$ what about $f$ and $f^{-1}$ for an invertible function? Then you have $f\circ f^{-1}=f^{-1}\circ f=\operatorname{id}$. By example $e^{\ln x}=\ln(e^x)=x$ for $x\in[1,\infty)$. $\endgroup$
    – Masacroso
    Jul 24 '17 at 18:30

Yes, you can. To satisfy these conditions, $g$ has to be the identity map on the range of $f$, but you can play with other elements (in the complement of the range of $f$) to define $g$ that is different from both $f$ and the identity map.

Here's an example. Let $X=\{1,2,3\}$ and define the two maps $f,g : X\to X$ as follows: $$f(1)=1,f(2)=1,f(3)=1 \quad \text{and} \quad g(1)=1,g(2)=3,g(3)=2.$$ (It looks much better as a diagram, but I don't know how to create one quickly.)


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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