I understand that for composite function $(g\circ f)(x)$ to exist, range of $f(x)$ must be a subset of domain of $g(x)$. This is so that every output value of $f(x)$ is mapped to one value of $g(x)$.
However, is this on the assumption that both $g(x)$ and $f(x)$ are functions? Must they both be functions?
Imagine a case where $f(x) = \pm \sqrt{x}$ and $g(x) = x^2$. in this case $g(f(x))$ is a function right? So I suppose we do not need both $g(x)$ and $f(x)$ to be functions?
So what does "range of $f(x)$ must be a subset of domain of $g(x)$" actually conclude?
Addon: I've realised that the example I have given, is for the special case when $g$ and $f$ are inverse of one another. so $(g\circ f)(x) = x$.
My conclusion is that for composite function $(g\circ f)(x)$ to exists, either
Am I right? Any help is much appreciated! I still need help.