$\int_{E_n} |g|^q = \left|\int_E \chi_{E_n}\cdot \text{sgn}(g)\cdot g \cdot |g|^{q-1}\cdot |g|\right|$

The last $|g|$ is wrong, maybe a typographical error or so. We have that $|g|^q=\operatorname{sign}(g)\cdot g\cdot |g|^{q-1}$ as $\operatorname{sign}(g)\cdot g=|g|$ and $|g|\cdot |g|^{q-1}=|g|^q$.

In general we define $\operatorname{sign}(g)$ as

$$ \operatorname{sign}(g):=\begin{cases} \frac{g}{|g|},&\text{ when }|g|\neq 0\\ 0,& \text{ otherwise } \end{cases} $$