I have to solve the following exercice : "Let $a, b$ > be two positive numbers. Let $G(z)$ be a function such that $G(z+a) = G(z)$ and $G(z+ib) = G(z)$ for all $z$ in the complex plane. Suppose that $G(0) = 0$ and $G(a/2) = 1$. Show that $G$ can not be analytic in the rectangle that contains all the $z$ with $-a < Re(z) < a$ and $-b < Im(z) < b$"
For me, I can deduce that $G(z+a) = G(z-a)$ and $G(z+ib) = G(z-ib)$ so the contour integral around the rectangle must be $0$. Then, by the Morera's theorem, $G(z)$ has to be analytic...
I don't know where I did a mistake in my reasoning but if you have an idea or just a hint feel free to answer!
If $G$ was analytic there, then it would be analytic in the smaller rectangle$$R=\left\{z\in\mathbb{C}\,\middle|\,\operatorname{Re}(z)\in\left[-\frac a2,\frac a2\right]\wedge\operatorname{Im}(z)\in\left[-\frac b2,\frac b2\right]\right\}.$$Since this region is compact, $G|_R$ is bounded. And, by the two periodicity conditions on $G$, the image of $G$ is equal to $G(R)$. Therefore, $G$ is bounded and so, by Liouville's theorem, it is constant. But $G(0)=0$ and $G\left(\frac a2\right)=1$.