First note that
$$\frac{\sigma'(x)}{\sigma(x)}=\sum_{i\in B}\frac 1{x-L_i}$$
and that if we write $C$ for the bit positions of a codeword, the Goppa code is defined by
$$\sum_{i\in C}\frac 1{x-L_i}\equiv 0\pmod{g(x)}$$
so that
$$\frac{\sigma'(x)}{\sigma(x)}\equiv\sum_{i\in B\ominus C}\frac 1{x-L_i}\pmod{g(x)}$$
and the right hand side is just $s(x)$.

We split $\sigma(x)$ into odd and even degree monomials so that we can find polynomials $\sigma_{odd}$ and$\sigma_{even}$ such that
$$\sigma(x)=x\sigma_{odd}(x^2)+\sigma_{even}(x^2). \qquad (1)$$
Because we are in a field of a characteristic 2, polynomials with only square terms are squares of other polynomials of degree at most $(\deg g-1)/2$ and we aim to recover $a(x)$ and $b(x)$ satisfying this degree bound such that $a(x)^2=\sigma_{even}(x^2)$ and $b(x)^2=\sigma_{odd}$.

Differentiating (1) gives
$$\sigma'(x)=\sigma_{odd}(x^2)$$
and so
$$\frac{\sigma(x)}{\sigma'(x)}=x+\frac{\sigma_{even}(x^2)}{\sigma_{odd}(x^2)}$$
which tells us that
$$\frac1{s(x)}-x\equiv \frac{\sigma_{even}(x^2)}{\sigma_{odd}(x^2)}\pmod{g(x)}.$$
Thus the polynomial $v(x)$ is equivalent to the rational function $a(x)/b(x)$ that we seek modulo $g(x)$. The extended Euclidean algorithm will return two polynomials such that
$$\frac{c(x)}{d(x)}\equiv v(x)\pmod{g(x)}$$
with $\deg c$ and $\deg d$ both less than $(\deg g)/2$ and these polynomials must be equal to our sought after $a(x)$ and $b(x)$ otherwise $a(x)d(x)-b(x)c(x)$ is a polynomial of degree less than $d$ and divisible by $g(x)$. Having recovered $a(x)$ and $b(x)$ we can now construct $\sigma(x)=a(x)^2+xb(x)^2$ which is the definition of $p(x)$ that is usually given.