Let $\theta$ and $f$ be two real analytic non-constant functions defined on $[0,2\pi]$. For simplicity we assume $f$ has just two critical values $m<M$ (in the picture $-1$ and $1$); we index as $\{f_j\}_{j \in\{1,2,...,N\}}$ its invertible branches. Our hypotesis is that $\theta$ and $f$ satisfy $\forall \;a\in(m,M)$ $$ \sum_j \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{|f'(f_j^{-1}(a))|}=0. $$ This is a balancing condition for 2-dimensional vectors represented with complex numbers and involving all points in a given level set (which is finite since $f$ is analytic).

EDIT. As pointed out in the comments it was probably unclear that the hypotesis is about a pair of functions $\theta$ and $f$ that satisfy the condition above. I am not claiming this relation holds for any $\theta$. Such pair of functions can for example be constructed by considering a closed regular curve on $[0,2\pi]$ of the form $$ \gamma(t)=\sum_{j=1}^N a_j \sin(j\cdot t)+i\sum_{j=1}^N b_j \cos(j\cdot t), $$ and observing that for example $\int_0^{2\pi}\gamma(t) \Bigl(\cos((N+1)\cdot t)\Bigl)^n=0$, $\forall n$. Reparametrizing by arc-length $t=v(s)$ and denoting with $\theta(s)$ the turning angle of $\gamma$ we get $$ \int \text{e}^{i\theta(s)} \Bigl(\cos((N+1)\cdot v(s))\Bigl)^n=0. $$ From here one can show that if such property holds for $\cos((N+1)\cdot v(s))$ then it must hold for any composition of this function with $g \in L^1$. Picking $g$ as the characteristic function of $[a,a+\delta]$ and derivating in $\delta$, we get the equality above for $f=\cos((N+1)\cdot v(s))$. You can read more about that in this other question of mine:

We observe

$$ 0=\lim_{a \to m^+} \sum_j \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{|f'(f_j^{-1}(a))|} = - 2 \lim_{a \to m^+} \sum_{j \text{ odd }} \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{f'(f_j^{-1}(a))}, $$ where the second equality follows from the analiticity of $f$ at inner points. Similarly, derivating in $a$, one obtains $\forall \; n \in \mathbb{N}$ $$ \lim_{a \to m^+} \frac{d^n}{da^n} \sum_{j \text{ odd }} \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{f'(f_j^{-1}(a))}=0. $$

I would like to prove from these hypoteses that also the sum over odd indices is constantly $0$, that is $\forall \;a\in(m,M)$. $$ \sum_{j \text{ odd }} \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{f'(f_j^{-1}(a))}=0. $$

Note that the fact that all the derivatives are $0$ in the limit is not enough. We could theoretically have something like $\text{e}^{-1/x}$, whose derivatives go to $0$ when $x$ approches $0$, but the function is not constant. Nevertheless, I have experimental evidence that this does not happen in our setting. I tried to exploit the fact that here we are dealing with a single analytic function and that its global behaviour is determined by its Taylor expansion at any point but I could not conclude the implication this question is about.

EDIT 2. Calling our function $F(a):=\sum_{j \text{ odd }} \frac{\text{e}^{i \theta(f_j^{-1}(a))}}{f'(f_j^{-1}(a))}$, proving that it is constantly $0$ is equivalent to prove the existence of $C_\varepsilon>0$ such that $$ \| F^{(n)}(a) \| \leq C_\varepsilon^{n+1} n!, \; \forall n \in \mathbb{N}, \; a \in (m,m+\varepsilon). $$ In this case, the series $0 \equiv \sum F^{(n)}(a) \frac{a^n}{n!}$ would converge uniformly to $F(s)$ in a neighbohood of $0$, providing the desired identity. This implication is explained for example in One-Sided Analyticity Condition Guarantees Analytic Function?.

Although this approach looks reasonable I am still stuck. Does anyone have some hints?

The question is pretty specific but I guess an answer in the positive could connect to properties of analytic functions interesting also from a more general perspective. Thanks.

arbitraryanalytic function, you can just interpolate it to be anything you want at the evaluation points, which will definitely destroy the suggested identity. $\endgroup$ – fedja Jan 27 at 16:22