Some properties of composite functions works only when $(\star) f: A \to B, g: B\to C, gof: A \to C$.
$(1)$ I told my university professor that I did not understand why the domain of $gof$ is equal to the domain of $f$.
$(2)$ I know how to arrive at the result that the codomain of $f$ is the domain of $g$. so that the composition gof is defined we need to $Im(f) \subseteq Dom(g)$ and since $Dom(g)$ contains the images of $f$ means that $Dom(g)$ is a codomain of $f$.
But for $(1)$(what I have not understood), he answered to me:
Now for the compound, when we write $f: A \to B$ and $g: B \to C$, we already know that the domain of $f$ is $A$, the codomain of $f$ is $B$ and the domain of $g$ is $B$. For any $a$ in $A$, we have $f (a)$ in $B$, so in the domain of $g$, therefore $g (f (a))$ is correctly defined. This shows that the domain of $gof$ is $A$.
and although what he tells me is true, since it is defined, i dont understand why that "shows that the domain of $gof$ is $A$", since i think that the domain of $gof$ does not need necessarily be the domain of $f$ to be defined.(Because of what I said in $(2)$ ). Let's take an example:
Let $f: \mathbb{R} \to [0, \infty),g: [0, \infty) \to \mathbb{R}^+$.
Here the form: $f: A \to B, g: B \to C$ is present, but $Dom(gof)$ is not $A$, i.e $\mathbb{R}$, here the domain of the $gof$ is $[0, \infty)$.
He replied that we can modify the domain and / or codomain in such a way that it is true, however I have not fully understood it and I have been confused.
So for some of the properties of the $gof$ compound functions (like this property or some of these properties) to be true, do they need to be defined like this$(\star)$? Or does it work for everyone and as my teacher answered me in $(1)$, must we change its domain and / or codomain? And if we must change it, how?