From the first condition, we need only two specializations: $y=x$ and $y=-x$, i.e.,
$$\tag 1g(2x)=2g(x)$$
and
$$\tag2 g(x)+g(-x)=g(0).$$
From $(1)$ with $x=0$, we find $g(0)=0$ and then from $(2)$, $g(-x)=-g(x)$.
We will also use the second condition only where it is clear that it makes sense, i.e., when $x>0$ and it is known that $g(x)>0$.
From $g(x^2)=g(x)^2$, we see $g(x)=g(\sqrt x)^2\ge0$ for all $x\ge 0$. Assume $g$ is not identically $0$, i.e., $g(x)\ne0$ for some $x$ (so clearly $x\ne 0$). Then by $(1)$ and $(2)$ also $g(-x)\ne 0$ and $g(\pm2x)\ne0$. At least one of these four is a positive number $\ne1$.
Thus we have $x_0\in(0,\infty)\setminus \{1\}$ with $g(x_0)>0$.
Then for $x>0$, $x\notin\{1,x_0\}$, we have
$$\ln g(x)=\ln g(x_0^{\log_{x_0}(x)})=\ln\left(g(x_0)^{\log_{x_0}(x)}\right)=\frac{\ln g(x_0)}{\ln x_0}\cdot\ln x.$$
In particular, $g(x)>0$ for all $x\notin \{-1,0,1\}$.
If additionally $x\notin \{\frac12,\frac 12x_0\}$, we obtain
$$\ln 2=\ln g(2x)-\ln g(x)=\frac{\ln g(x_0)}{\ln x_0}\cdot(\ln x+\ln 2)- \frac{\ln g(x_0)}{\ln x_0}\cdot\ln x=\frac{\ln g(x_0)}{\ln x_0}\cdot\ln 2$$
so that
$$ g(x_0)=x_0.$$
But as $g(x)>0$ for all $x>0$ except possibly $1$ and $x_0$, we could have picked any positive number $\ne1$ for $x_0$. Thus we find $g(x)=x$ for all $x>0$ except possibly $x=1$. Then by $(1)$, also $g(1)=2g(\frac12)=1$ and by $(2)$, $g(x)=x$ for all $x$.