In regards to your highlighted question, the sum will be normalised because each summand will only add a portion of unity. Below I write a proper proof of the density of $Y$ which makes it obvious as to why the sum adds to one.
Suppose that $g = \sum\limits_{i = 1}^k g_i \mathbf{1}_{\mathrm{J}_i},$ where the $\mathrm{J}_i$ are pairwise disjoint intervals and the $g_i$ are invertible and differentiable functions whose derivative is never zero (a fortiori they are strictly monotone). Let $Y = g(X).$ Then $$ \mathbf{P}(Y \leq t) = \mathbf{P}(g(X) \leq t) = \sum_{i = 1}^k \mathbf{P}(g(X) \leq t, X \in \mathrm{J}_i), $$ since the intervals are pairwise disjoint. If $X \in \mathrm{J}_i,$ then $g(X) = g_i(X),$ which is invertible. Therefore $$ \mathbf{P}(Y \leq t) = \sum_{i = 1}^k \mathbf{P}(X \in g_i^{-1}(-\infty,t] \cap \mathrm{J}_i). $$ Each $g_i^{-1}(-\infty, t] \cap \mathrm{J}_i$ is an interval; if $g_i$ is increasing and $\inf \mathrm{J}_i = a_i,$ $\sup \mathrm{J}_i = b_i,$ then this interval will have extremes $a_i$ and $\min \left(g_i^{-1}(t), b_i \right);$ if $g_i$ is decreasing, then the extremes of the interval will be $\max \left( a_i, g_i^{-1}(t) \right)$ and $b_i.$ Thus, when $g_i$ is increasing, the summand corresponding to it in $\mathbf{P}(Y \leq t)$ will be $F_X \left( \min \left(g_i^{-1}(t), b_i \right) \right) - F_X(a_i);$ when $g_i$ is decreasing, the summand will be $F_X(b_i) - F_X \left( \max \left( a_i, g_i^{-1}(t) \right) \right).$ The derivatives of these functions of $t$ are, respectively, $$ f_X\left( \min \left(g_i^{-1}(t), b_i \right) \right) \big( g_i^{-1}(t) \big)' \mathbf{1}(g_i^{-1}(t) \leq b_i), \qquad g_i \text{ is increasing}, $$ and $$ -f_X\left( \max \left(a_i, g_i^{-1}(t) \right) \right) \big( g_i^{-1}(t) \big)' \mathbf{1}(g_i^{-1}(t) \geq a_i), \qquad g_i \text{ is decreasing}. $$ Recall that $\big( g_i^{-1}(t) \big)' = \dfrac{1}{g_i' \left( g_i^{-1}(t) \right)}$ is positive if $g_i$ is increasing, and negative otherwise, and your book seems to write $t = y,$ and $g_i^{-1}(t) = x_i,$ also when the above indicator functions are not zero, $f_X$ is evaluated in $g_i^{-1}(t).$ In addition, the conditions $g_i^{-1}(t) \leq b_i$ for $g_i$ increasing, and $g_i^{-1}(t) \geq a$ for $g_i$ decreasing translate to $t \in g_i(\mathrm{J}_i).$ Therefore, with all the aforementioned considerations, the density of $Y$ is $$ f_Y(y) = \sum_{i = 1}^k \dfrac{f_X(x_i)}{|g_i'(x_i)|} \mathbf{1}_{g_i(\mathrm{J}_i)}(y). $$