The quotient $K = \operatorname{GF}(2^m)[x]/(g)$ is again a finite field of characteristic $2$.
The map
$$
f
\colon K
\to K,
\quad y
\mapsto y^2
$$
is additive because
$$
f(y_1 + y_2)
= (y_1 + y_2)^2
= y_1^2 + 2y_1y_2 + y_2^2
= y_1^2 + y_2^2
= f(y_1) + f(y_2).
$$
We have that $\ker(f) = 0$, so $f$ is injective, and because $K$ is finite therefore also surjective.
(The map $f$ is actually a field automorphism, the so called Frobenius homomorphism.)
It follows for $\overline{p} \in K$ that there exists some $\overline{q} \in K$ with $\overline{q}^2 = \overline{p}$, which means that for the polynomials $p, q \in \operatorname{GF}(2^m)[x]$ we have that $q^2 \equiv p \pmod{g}$.
PS: As was pointed out by Ravi Fernando in the comments, one can be more explicit:
For $n \geq 1$ with $K \cong \operatorname{GF}(2^n)$ (namely $n = m \cdot \deg(g)$) we have that $y^{2^n} = y$ for all $y \in K$.
(This is clear for $y = 0$, and for $y \neq 0$ we have that $y \in K^\times$, which is a group of order $2^n - 1$, which is why $y^{2^n - 1} = 1$.)
It follows that $y = y^{2^n} = (y^{2^{n-1}})^2$ for every $y \in K$.