# Domain of a composite function

In set theory, given 2 functions:

$f:A\to B$

and

$g:B\to C$

Suppose set $A = \{1, 2, 3\}$, set $B = \{a, b, c, d,\}$, and set $C = \{X, Y, Z\}$. And $f(1) = a$, $f(2) = b$, $f(3) = c$.

I know that the domain of $g$ in $g(x)$ where $x\in B$ is $\{a, b, c, d\}$, but just to make things clear, I want to ask :

What is the domain of $g$ in $g\circ f$? Would it still be $\{a, b, c, d\}$ or would it be $\{a, b, c\}$ in this case.

If we think about $g\circ f:A\to C$ as a single function, then clearly the domain of $g\circ f$ equals the domain of $f$, which is $A$. Technically, the domain of $g$ is unchanged; it is still $B$.

However, in constructing the function $g\circ f$, we do restrict the domain of $g$ to the range of $f$.

• So for the opening question, the domain of $g$ in $g\circ f$ is in this case? – Gin99 May 22 '16 at 8:12
• $g\circ f$ is a single function. It is the function that takes $x\in A$ and sends it to $g(f(x))$. You can think about it as though we are restricting $g$ to the range of $f$ in this case. – Alekos Robotis May 22 '16 at 9:03
• I am slightly hesitant only because $g\circ f$ is just a single function, we could call it $h$ if we wanted to. $g$ doesn't have any special domain in $g\circ f$. We use this notation to denote the fact that $x\in A\mapsto g(f(x))\in C.$ – Alekos Robotis May 22 '16 at 9:07

Think about it this way: What would happen if we insisted that, as you say, the domain of $g$ in $g\circ f$ was indeed $\{a,b,c,d\}$ ?

This would force $f$ to no longer be a function since an element of the domain of $f$, $\{1,2,3\}$, would need to map to two distinct elements of $\{a,b,c,d\}$.

The function $f$ maps onto a subset of the domain of $g$. What the function $g$ 'does' with the element $d$ of $\{a,b,c,d\}$ does not show up in our definition of the function $g\circ f$.

• Ok thanks. This clears up some of the other things that has been confusing me. – Gin99 May 22 '16 at 9:59
• But when trying to construct $g\circ f$ we do take the image of $f$ as the input of $g$ in order to get the image of $g$ in $g\circ f$, right? So that even if $g(d)$ does have a value in set $C$ (let's just say $g(d)=Z$ for example), that still doesn't mean that d will get inputed to the $g$ in $g\circ f$ simply because $d$ is not in the image of $f$. Please Correct me if I'm wrong. – Gin99 May 22 '16 at 10:07
• Yes, that is the correct way to think about it. Its important to see that the domain of $g$ is then still the set $B$, but $g\circ f$ does not make use of the entire domain. – Walt van Amstel May 22 '16 at 10:17