Is this correct? (Edit: I'm just going to outline the steps and post the rest as an answer.)
$g: \mathbb C \to \mathbb C, g(z) = -i(1-y^2)+(2x-y)(y)$
Step 1. $g$ is differentiable only on $\{y=x\}$.
Step 2. $g$ is differentiable on $\{y=x\}$ (given $g$ is differentiable only on $\{y=x\}$).
Step 3. For $z \in \{y=x\}$, we have $g'(z)=2\Im(z)$.
Proof of Step 1:
If $g$ is differentiable at $(x,y)$, then the Cauchy Riemann equations are satisfied at $(x,y)$. We get for $u(x,y)=(2x-y)(y)$ and $v(x,y)=-(1-y^2)$ with $u,v:\mathbb R^2 \to \mathbb R$ that
$$u_x=2y, u_y=2(x-y), v_x=0, v_y=2y$$
and then
$$2y = u_x(x,y) = v_y(x,y) = 2y \iff (x,y) \in \mathbb R^2$$
$$2(x-y) = u_y(x,y) = -v_x(x,y) = -(0) = 0 \iff x=y$$
Proof of Step 2:
$g_x=u_x+iv_x, g_y=u_y+iv_y$ exist on the neighbourhood $\mathbb C$ of $0=0+0i=(0,0)$ and then are continuous at $(0,0).
Proof of Step 3:
$g'(z)=g_x(x,y)=u_x(x,y)+iv_x(x,y)=2y+i(0)=2y=2\Im(z)$.