Does $f \circ (f \circ g) = f \circ(g \circ f)$ imply $f = g$?

149 Views Asked by At

If f and g are functions such that $f \circ (f \circ g) = f \circ(g \circ f)$, then $f = g$.

I am really confuse at this question and unable to identify if the function is true or false. Can anyone please show me how to prove this statement or disprove by providing counterexample? Thanks

3

There are 3 best solutions below

3
On

Just take two different functions $f,g$, which commute, i.e., with $f\circ g=g\cdot f$. An example would be $f(x)=x$, $g(x)=\frac{1}{x}$.

1
On

Another counter example are projectors (i.e. $p\circ p=p$)

For instance in $\mathbb R^3$ let's have $f=P_{xy}$ and $g=P_{yz}$, respectively the projectors on the plane XY and on the plane YZ.

Then $\begin{cases} f\circ g\circ f(x,y,z)=f\circ g(x,y,0)=f(0,y,0)=(0,y,0)\\ f\circ f\circ g(x,y,z)=f\circ f(0,y,z)=f(0,y,0)=(0,y,0)\\ \end{cases}$

So $f\circ g\circ f=f\circ f\circ g$ but $f\neq g$.


But it is possible to find counter examples even when $f$ and $g$ do not commute.

This requires $f$ to take the same values $f(a)=f(b)$ for $a\neq b$ with $a=f(g(x))$ and $b=g(f(x))$

  • Let's start with a basic example

$\begin{cases} f(0)=f(1)=1,\ f(x)=??\ \text{elsewhere}\\ g(x)=0\end{cases}\implies\begin{cases}a=f(g(x))=f(0)=1 \\b=g(f(x))=0\end{cases}\quad$

yet $f(a)=f(b)=1$.

  • Or let's take $f$ even and $g$ always negative and even.

$\begin{cases} f(x)=|x|\\ g(x)=-e^{x^2}\end{cases}\implies\begin{cases}a=f(g(x))=e^{x^2}\\b=g(f(x))=-e^{x^2}\end{cases}\quad$

yet $f(a)=f(b)=e^{x^2}$.

  • We could also take $f$ periodic and $g$ a translation.

$\begin{cases} f(x)=\sin(x)\\ g(x)=2\pi+x\end{cases}\implies\begin{cases}a=f(g(x))=\sin(2\pi+x)=\sin(x)\\b=g(f(x))=2\pi+\sin(x)\end{cases}\quad$

yet $f(a)=f(b)=\sin(\sin(x))$.

  • You can even combine the two above.

$\begin{cases} f(x)=\sin(x)\\ g(x)=\pi+x\end{cases}\implies\begin{cases}a=f(g(x))=\sin(\pi+x)=-\sin(x)\\b=g(f(x))=\pi+\sin(x)\end{cases}\quad$

$f(a)=\sin(-\sin(x))=-\sin(\sin(x))$

$f(b)=\sin(\pi+\sin(x))=-\sin(\sin(x))=f(a)$.

It's up to your imagination to find counter examples...

0
On

Be $f$ a constant function. Then for any function $h$, you have $f\circ h=f$. This is in particular true for both $h=f\circ g$ and $h=g\circ f$, no matter what $g$ is. In particular, it also holds for $g\ne f$.