It is enough to consider the equation for $x = y$ only, so the rest of the equation will be useless for us.

First, plugging $x = y = 0$ we get $g'(0)^2 + g(0)^2 = g'(0)$. Since $g$ is odd, $g(0) = 0$ so $g'(0) = 1$ or $g'(0) = 0$. If $g'(0) = 0$, then for all $x$ we have $g'(x)^2 + g(x)^2 = 0$, so $g(x) = 0$. So, $g'(0) = 1$ from now on.

Now, in some vicinity of $0$ we have $g'(x) > 0$ since $g\in C^1$. Then in this vicinity we have
$$g'(x) = \sqrt{1 - g(x)^2}.$$

This is a differential equation, and until $|g(x)| = 1$ right-hand side is smooth, so existence and uniqueness theorem applies. Therefore, in the vicinity of $0$ our function must coincide with $\sin(x)$ (we used that $g$ is odd really only to have $g(0) = 0$). By the standard extension theorem this can go at least to the singularity of our differential equation, so $g(x) = \sin(x), |x| \le \frac{\pi}{2}$.

Note that after that $g(x)$ can be equal to $1$ for an arbitrarily long time (unless we also assume that $g\in C^2$ in which case we don't even need $2\pi$-periodicity and I think with some tedious work condition of $g$ being odd can also be removed). So, we have to use $2\pi$-periodicity somehow. We know that for $\frac{3\pi}{2} \le x \le 2\pi$ we have $g(x) = \sin(x)$. Consider the interval from $x_1 =\frac{\pi}{2}$ to $x_2 = \frac{3\pi}{2}$. We have $g(x_1) = 1$, $g(x_2) = -1$. So, there must exist $x_1 < x_0 < x_2$ such that $g(x_0) = 0$.

We have $g'(x_0)^2 = 1$, so $g'(x_0) = \pm 1$. By repeating the argument with differential equation from above (except we have to add an appropriate sign to it) we can see that in the interval $[x_0 - \frac{\pi}{2}, x_0 + \frac{\pi}{2}]$ our function must be $\pm \sin(x-x_0)$. However, if $x_0\neq \pi$ then this interval either contains $x_1$ or $x_2$ and the value at it would be smaller than $1$ in absolute value, which is a contradiction. So, $x_0 = \pi$. Finally, if $g'(x_0) = 1$ then we would still have contradiction for the value of $g(x_1)$, say (it would be $-1$ from the differential equation, while we already established that it is $1$). Thus, on $[x_0 - \frac{\pi}{2}, x_0 + \frac{\pi}{2}]$ we have $g(x) = -\sin(x-x_0) = \sin(x)$. So, $g(x) = \sin(x)$ on $[0, \frac{\pi}{2}]$, on $[\frac{\pi}{2}, \frac{3\pi}{2}]$ and on $[\frac{3\pi}{2}, 2\pi]$, so it is $\sin(x)$ everywhere by $2\pi$-periodicity.

As I said, must of the conditions can be likely relaxed or removed, and only the equation for $x = y$ was used, but the condition $g\in C^1$ does seem to be essential, because otherwise the sign of the derivative can jump and it is not clear to me how to proceed.