Assumptions
$g$ is differentiable on $[0,1]$,
$g'(0) = g'(1) = 0$,
$g(1)>g(0)$.
Attempt
Since $g$ is differentiable on $[0,1]$ then it is also continuous on $[0,1]$. So by the Mean Value Theorem there exists at least a number $x\in[0,1]$ such that
$$g'(x) = \frac{g(1)-g(0)}{1-0} = g(1) - g(0).$$
Now it is given that $g'(0)=g'(1)=0$ which implies that (since $g$ is differentiable on $[0,1]$).
$$ g(0) = g(1) = k$$
where $k\in \mathbb{R}$ is some constant.
$$\implies g(1) - g(0) = k > 0$$ since $g(1)>g(0)$.
Which means that
$$ y \in [0,g(1)-g(0)] \implies y \in [0,k] \implies y = k \geq 0$$
Therefore,
$$ g'(x) = g(1) - g(0) = k = y $$
as required.
Is this correct?
Darboux Theorem: If $f$ is differentiable on $[0,1]$, suppose $k$ is between $f'(0)$ and $f'(1)$. Then there exists at least a number $\xi\in(0,1)$ such that $$f'(\xi)=k.$$
Use Darboux Theorem for your case: by the Mean Value Theorem there exists at least a number $x_0\in(0,1)$ such that $$g'(x_0)= \frac{g(1)-g(0)}{1-0} = g(1) - g(0).$$ Consider the function $g$ defined on $[0,x_0]$, observe that $g'(0)=0,g'(x_0)=g(1)-g(0)$, the Darboux Theorem implies your result!