Price Derivation in a Production Function Here is a composite goods production function:

And here is the price ratio of Ys and Yg, derived from their marginal products: 

Then the author normalized the price of final goods Y to 1 and somehow got the following relationship:

How is the last equation derived?

Thank you!
Rewrite the first equation as
$$Y^{\frac{\rho-1}{\rho}} = Y_s^{\frac{\rho-1}{\rho}} + Y_g^{\frac{\rho-1}{\rho}}. $$

Divide both sides by $Y_s^{\frac{\rho-1}{\rho}}$ to obtain

$$\left(\frac{Y}{Y_g}\right)^{\frac{\rho-1}{\rho}} = 1 + \left(\frac{Y_s}{Y_g}\right)^{\frac{\rho-1}{\rho}}.$$

Substitute the price-ratio and production-ratio relationships as in your second equation and make some algebraic changes, and you will get your last equation.  Note: I interpreted ``the price of $Y$ normalized to $1$'' as $\frac{p_g}{p_Y} = p_g= \left(\frac{Y}{Y_g}\right)^{\frac{1}{\rho}}$.