Let us denote the ideal $\langle g(X)\rangle\subset F[X]$ by $I$. As $g(X)$ was assumed to be irreducible, $I$ is a maximal ideal. Thus the quotient ring $K=F[X]/I$ is another finite field of characteristic two. In such a field squaring, $f(t)=t^2$, is a bijection (aka the Frobenius automorphism). Therefore there exists an element $w\in K$ such that $f(w)=X+I$. The element $w$ is of the form $w=w(X)+I$ for some polynomial $w(X)\in F[X]$. Therefore $ X+I=f(w)=(w(X)+I)^2=w(X)^2+I, $ which is exactly the claimed polynomial congruence $ w(X)^2\equiv X \pmod I. $