Let $X, Y$ be locally convex spaces over $\mathbb{R}$ and $f: X \to Y$. Suppose $f$ is Fréchet differentiable at a point $x_{0} \in X$. Given an interval $0 \in I \subset \mathbb{R}$, we call a smooth curve $\gamma: I \to X$ an integral curve for $x_{0}$ if $\gamma(0) = x_{0}$. Is it true that: $$\frac{d(f\circ \gamma)(t)}{dt}\bigg{|}_{t=0} = 0$$ for every integral curve $\gamma$ for $x_{0}$ implies that $x_{0}$ is a critical point for $f$, in the sense that its derivative at $x_{0}$ is zero?
I think the answer is yes, and here's why. Suppose $\gamma(t) = x_{0}+ty$ for some $y \in X$. Then $\gamma'(t) = y$, meaning that it is the linear map $\mathbb{R} \ni h \mapsto hy$. If the chain rule is valid in the locally convex spaces, then: $$\frac{d(f\circ \gamma)(t)}{dt}\bigg{|}_{t=0} = f'(\gamma(0))\circ \gamma'(0) = hf'(\gamma(0))(y) = 0$$ since $f'(\gamma(t))$ is supposed to be linear for every $t$. Thus, $\gamma(0) = x_{0}$ is a critical point of $f$.
The problem is that I have not much experience with differentiability on locally convex spaces, and I don't have any good reference on the subject at hand. Hence, I don't know if the chain rule holds and how to prove it (at least in my case). Any guidance on this direction or even an alternative proof is welcome.
Your reasoning is absolutely correct, and yes, $x_0$ would be a critical point of $f$ in this case. There is nothing here that employs the fact that the spaces are locally convex (in particular, certainly the chain rule applies in any NVS).
Indeed, as you mention, since $D(f \circ \gamma)(0) = 0$ for all integral curves for $x_0$, then we can for each $y \in X$ consider $\gamma_y: I \to X$ given by $\gamma_y(t) = x_0 + ty$. This $\gamma_y$ is smooth and satisfies $\gamma_y(0) = x_0$, so $D(f \circ \gamma_y)(0) = 0$.
By the chain rule, we have $D(f \circ \gamma_y)(0) = Df(\gamma_y(0))[\gamma'(0)] = Df(x_0)[y]$.
We conclude that $\forall y \in X$, $Df(x_0)[y] = 0$. This means that $Df(x_0) \equiv 0$. Therefore, $x_0$ is a critical point of $f$.