In complex analysis, there is a theorem that says whenever two curves $\gamma_0$ and $\gamma_1$ are homotopic and contained in an open set $\Omega$ in which $f$ is holomorphic, then we have
$\int_{\gamma_0}f(z)dz = \int_{\gamma_1}f(z)dz$
I spotted, with an informal derivation, that this obeys the Euler-Lagrange conditions, for $z(t)$ being the function that varies in the functional. Could you then argue, loosely speaking, that as the 'functional limit' (I haven't studied functionals in any great detail) is zero everywhere, then the functional must be constant?
The Lagrangian is $$L(z,\bar{z},\dot{z},\dot{\bar{z}}, t)~=~f(z,\bar{z})\dot{z}.\tag{0}$$ The Euler-Lagrange (EL) equations are necessary & sufficient conditions for a stationary curve. The EL equations read in complex notation $$ \frac{df}{dt}~\stackrel{(0)}{=}~ \frac{d}{dt}\frac{\partial L}{\partial \dot{z}}~\stackrel{?}{=}~\frac{\partial L}{\partial z}~\stackrel{(0)}{=}~\frac{\partial f}{\partial z}\dot{z},\tag{1}$$ $$ 0~\stackrel{(0)}{=}~ \frac{d}{dt}\frac{\partial L}{\partial \dot{\bar{z}}}~\stackrel{?}{=}~\frac{\partial L}{\partial \bar{z}}~\stackrel{(0)}{=}~\frac{\partial f}{\partial \bar{z}}\dot{z}.\tag{2}$$ Let there be given 2 fixed endpoints. Now assume that any curve $\gamma$ between the 2 endpoints are a stationary curve for the action. It then follows from eq. (2) that the function $f$ is holomorphic. In turn eq. (1) becomes trivially satisfied.
The above result is closely related to Morera's theorem, which is sort of opposite to Cauchy's theorem.