The map $\pi : \mathbb R \longrightarrow \mathbb S^1$, $\pi(x)=e^{2i\pi x}$ is the universal cover of the unit circle. Let's lift the map $f$ to $F : \mathbb R \longrightarrow \mathbb R$ which is now $1$-periodic. $F$ is also real-analytic. So for each $x_0 \in \mathbb R$ there exist $\varepsilon > 0$ such that $F(x) = \sum_{n \geq 0}a_n(x-x_0)^n$ (the sequence $(a_n)$ may depends on $x_0$). For simplicity, let's assume $x_0 = 0$.
$F(x) = \sum_{n \geq 0}a_nx^n$ on $(-\varepsilon,+\varepsilon)$. Let's extend $F$ to the disc centered at $0 = x_0$ of radius $\varepsilon$:
$\tilde{F}(z) = \sum_{n \geq 0}a_n z^n$ on $D(0,\varepsilon)$
It's obvious that the restriction of $\tilde{F}$ to the real line is $F$, and $\tilde{F}$ is holomorphic since it's analytic. We can go back to the circle.