The coming below is nothing else but thinking loudly. The differential operator $$ D=\operatorname{id}+x\frac d{dx}\colon h\mapsto (xh)' $$ "kills" the unwanted odd powers modulo 2. Indeed, if $$ h=\sum_{n=0}^\infty a_nx^n=a_0+a_1x+a_2x^2+\dots, $$ then $$ Dh=\sum_ {n=0}^\infty (n+1)a_nx^n \equiv\sum_ {k=0}^\infty a_ {2k}x^{2k}\pmod 2 $$ where the congruence is applied to all coefficients in the power series expansions. Therefore, the OP asks for the congruence $$ D\biggl(\frac fg\biggr)\overset?\equiv D(f)\pmod 2 $$ to be true, which after multiplication by $g^2$ becomes (modulo 2) the congruence $$ D(fg)\overset?\equiv D(f)g^2\equiv D(fg^2)\pmod{2}, $$ equivalently, $$ \frac{d}{dx}\bigl(xf(x)g(x)\bigr) \overset?\equiv\frac{d}{dx}\bigl(xf(x)g(x)^2\bigr)\pmod{2}.\qquad\qquad\qquad(*) $$ The function $f(x)$ can be in a certain sense eliminated from the required formula by using $$ g(x)=\sum_{n=0}^\infty x^{n^2} =\sum_{m=0}^\infty x^{(2m+1)^2} +\sum_{m=0}^\infty x^{(2m)^2} =xf(x^8)+g(x^4) $$ which implies $$ f(x)=\frac{g(x^{1/8})-g(x^{1/2})}{x^{1/8}}. $$ In addition, we can use repeatedly $$ h(x^2)\equiv h(x)^2\pmod{2}. $$ If I am correct in my derivation, ($ * $) reduces to $$ \frac{d}{dx}\bigl(x(g-g^4)(g^8-g^{16})\bigr) \overset?\equiv0\pmod{2}.\qquad\qquad\qquad(**) $$