Composition of a function and a scalar Are the following true?


*

*$\operatorname{scalar} \circ \operatorname{function} = \operatorname{scalar} \times \operatorname{function}$

*$\operatorname{function} \circ \operatorname{scalar} = $ the function evaluated at that scalar.
Background:
Let $f:E \to F, g: F \to G$, where $E,F$ and $G$ are normed vector spaces. The chain rule tells us: if $f$ is differentiable at $x_0$ and $g$ is differentiable at $f(x_0)$, then $g \circ f$ is differentiable at $x_0$, and:
$$D(g\circ f)(x_0) = Dg(f(x_0)) \circ Df(x_0)$$
I'm having some confusions when it happens that one of these mappings is a scalar.
For instance, to find the differential of the square root of the inner product on a real pre-Hilbert space ($0$ excluded), we would define the mapping $x \to \langle x, x \rangle$, find its differential, then consider the square root map on $(0, \infty)$. The square root of the inner product is just the composition of these two. But how does its differential map look like?

If $V$ is your pre-Hilbert space (which I am assuming is real), then let $$f:\  V \to \Bbb R\ :\ x \mapsto \langle x, x \rangle$$ Then for each $x \in V, Df|_x$ is a linear map from $V \to \Bbb R\ :\ v \mapsto 2\langle x, v\rangle$. Let $$g\ :\ \Bbb R \to \Bbb R\ :\ t \mapsto \sqrt t$$
Then $Dg|_t$ is a linear map from $\Bbb R \to \Bbb R\ :\ q \mapsto \frac{q}{2\sqrt t}$.
Hence $$\begin{align} D(g\circ f)|_x(v)&= Dg|_{f(x)}\circ Df|_x(v)
\\&=Dg|_{\langle x, x\rangle}(2\langle x, v\rangle)
\\&=\frac{2\langle x, v\rangle}{2\sqrt{\langle x, x\rangle}}
\\&=\frac{\langle x, v\rangle}{\|x\|}\end{align}$$
You have to remember that the differential is always a linear map. Even when we choose to represent it as a scalar, this is only because linear maps $\Bbb R \to \Bbb R$ are just scalar multiplication.
