Let $X,Y,Z$ be locally convex topological vector spaces over $\mathbb R$ (not necessarily Banach), $D_X \subseteq X$, $D_Y \subseteq Y$ and let $f \colon D_X \to D_Y$, $g \colon D_Y \to Z$. Let us assume that $f$ is Gateaux-differentiable in some $x \in D_X$ and $g$ is Gateaux-differentiable in $f(x)$.
Which are the least well-known additional conditions for the chain rule to hold? By the chain rule I mean the assertion that $g \circ f$ is Gateaux-differentiable and $\mathrm d(g \circ f)(x;\cdot) = \mathrm d g(f(x);\mathrm d f(x;\cdot))$.
Wikipedia says that continuity of the derivatives of $f$ and $g$ is required, but it does not specify whether this means that only $\mathrm df \colon D_X \times X \to Y$ should be continuous or, more than that, $x \mapsto \mathrm df(x,\cdot) \in L(X,Y)$ should be continuous (and, of course, the same for $g$).
And is it generally assumed that $D_X$ and $D_Y$ are open or is it enough to know that they are neighborhoods of $x$ and $f(x)$?
Please also help me to find a citable reference. I looked into some books, but have not found this chain rule.
Since this question got no answers after a few days, I also posted it on mathoverflow.