Suppose $f$ and $g$ are both functions from $A$ to $A$. If $f \circ f = g \circ g$, does it follow that $f = g$?

159 Views Asked by At

We know that $(f(f(a)) = g(g(a))$ for some $a \in A$. I've tried and tried, both with a finite and infinite $A$, but I can't seem to find a counterexample wherein $f$ and $g$ are not the same. Apologies for the simple question, but I'd appreciate a nudge.

4

There are 4 best solutions below

0
On BEST ANSWER

Take $$A=\{1,2\},\qquad f(1)=1,\ f(2)=2,\qquad g(1)=2,\ g(2)=1.$$

If you want $A$ infinite take $A=\mathbb Z$, $f(x)=x$, $g(x)=-x$.

2
On

No, it is not true. Take $A=\{1,-1\}$, defined $f(x)=x$, and $g(x)=-x$. Then $f\circ f=g\circ g$, but $f\ne g$.

0
On

Take $$A=(0,+\infty)$$

$$f(x)=x$$

$$g(x)=\frac 1x$$

then

$$(\forall x>0) \;\;\; f(f(x))=g(g(x))$$

0
On

Any nontrivial involution $f$ provides a counterexample, since you can take $g$ to be the identity function.

For example, take $f:\mathbb C\to\mathbb C$ with $f(z) = 1-z$ and $g = \operatorname{Id}_{\mathbb C}$. Then $f(f(z)) = 1-(1-z)=z=g(g(z))$, but $f\neq g$.