Based on multivariable density find singlevariable one. Random variable has a density function of $$g(x,y)=1_{\{0 \le y \le 1-|x|\}}$$
Now I need to find a density of those two variables (X and Y separately) , however I have doubts about integration. What should be the limits of those integrals how they precisely should look?

Hint: The domain of $g(x,y)$ is 
$$-1\le x \le 1 \qquad 0\le y\le 1-|x|$$ or if you solve the absolute value $$(-1\le x\le 0,\, 0\le y\le 1+x) \qquad \text{and}\qquad (0< x\le 1, \, 0\le y\le 1-x)$$

So $$g_X(x)=\int_{Y}g(x,y)dy=\begin{cases}\int_{0}^{1-x}dy, & \text{if } 0<x\le 1\\[0.3cm]\int_{0}^{1+x}dy, & \text{if } -1<x\le 0\end{cases}$$ and similarly for $g_Y(y)$.
