With the usual function notation, one denotes functions as $f: A \to B$, where $A$ and $B$ are sets (see [here](https://math.stackexchange.com/questions/4277004/function-notation-for-arguments)), e.g. $f: \mathbb{R} \to \mathbb{R}$ for $f(x) = x^2$.

My question is: What would the notation be if a function $f$ takes another function $g: C \to D$, where $C$ and $D$ are again sets, as its argument?

~~Would it be $\require{enclose}
 \enclose{horizontalstrike}{f: D \to B}$? Or $\require{enclose}
 \enclose{horizontalstrike}{f: C \to B}$? Or something else?~~

~~I am leaning towards the second option because set $\require{enclose}
 \enclose{horizontalstrike}D$ should match set $\require{enclose}
 \enclose{horizontalstrike}A$ as the output of function $\require{enclose}
 \enclose{horizontalstrike}g$ is the input to $\require{enclose}
 \enclose{horizontalstrike}f$. I am not sure whether this is always the case and whether I am missing something, however.~~

Edit: Matthew Towers is absolutely right, what I was wrongfully thinking of was composition of functions. The question, however, is targeted at a function that takes another function as input and I do not know what the notation would look like in that case.