Does $f(z+2\pi)=f(z)$ for all $z\in \mathbb{C}$?

If $f:\mathbb{C}\rightarrow\mathbb{C}$ is a differentiable function and $f(x+2\pi)=f(x)$ for all $x\in \mathbb{R}$, would $f(z+2\pi)=f(z)$ for all $z\in \mathbb{C}$?

Is there any theorem/lemma concerning this? Are there any examples/counter examples for this?


Solution 1:

If $f$ is holomorphic, then $g(z) = f(z+2\pi)$ also is. But since $f$ and $g$ are equal on $\mathbb{R}$, the identity theorem tells us they are equal on $\mathbb{C}$.

Now if you only assume differentiability as a function on $\mathbb{R}^2$, there are counter examples. Take for example $f(x+iy) = \sin(yx)$.