Trying to figure out whether or not $f \circ h$ exists: The codomain of a function $h$ is $\{1,2,3\}$, and the domain of another function $f$ is $\{1,2,3,4\}$. The codomain of $h$ is a subset of the domain of $f$, but they are not equal.
So would $f \circ h$ not exist? I believe they do not exist, but I am not 100% sure.
The codomain of $h$ has to be a subset of the domain of $f$.
Consider for $x$ in the domain of $h$ you get $f\circ h(x)= f( h(x))$. Hence, $f\circ h(x)$ is welldefined iff $h(x)$ is in the domain of $f$. But you don't need that the codomain of $h$ has to be the whole domain of $f$.