6. (8%) Let $X$ and $Y$ be two random variables. $X$ has the p.d.f. $f_X(x) = 2x, 0 \le x \le 1$, and $Y = g(X)$. If $Y$ has the p.d.f. $f_Y(y) = e^{-y}, y > 0$, find the function $g(x)$.