Confusion about composite function and their ranges

30 Views Asked by At

let us take for example the two element set $\{a,b\}$ and the mappings $f:\{a,b\}\rightarrow a$ and $g:\{a,b\}\rightarrow b$. Then $g\circ f:\{a,b\}\rightarrow b$ and $f\circ g:\{a,b\}\rightarrow a$.

I am not entirely sure how this mapping works.

Functions $f$ and $g$ are defined on the set $\{a,b\}$. Does this mean that we use $\{a,b\}$ as the range for each mapping instead of the image of the first mapping?

Perhaps a bit more elaboration of my problem may help.

What I think is happening : $f\circ g(\{a,b\})=f(b)=a$. So at the step $f(b)$ do we use $\{a,b\}$ as the domain instead of the image of the function $g$ or are we mapping $b$ (the image of $g$) to $a$ ?