The joint density is
$$
f_{X,Y}(x,y)=\frac1{2x^2y}\mathbf 1_{y\gt0}\,\mathbf 1_{x\geqslant\max\{y,1/y\}}.
$$
To get the marginal densities, one integrates the joint density, for example,
$$
f_Y(y)=\frac1{2y}\mathbf 1_{y\gt0}\,\int_{\max\{y,1/y\}}^\infty\frac1{x^2}\mathrm dx=\frac1{2y\max\{y,1/y\}}\mathbf 1_{y\gt0}.
$$
Now one simply has to identify $2y\max\{y,1/y\}$ for $y$ in $(0,1)$ and for $y$ in $(1,\infty)$.
The joint density is $$ f_{X,Y}(x,y)=\frac1{2x^2y}\mathbf 1_{y\gt0}\,\mathbf 1_{x\geqslant\max\{y,1/y\}}. $$ To get the marginal densities, one integrates the joint density, for example, $$ f_Y(y)=\frac1{2y}\mathbf 1_{y\gt0}\,\int_{\max\{y,1/y\}}^\infty\frac1{x^2}\mathrm dx=\frac1{2y\max\{y,1/y\}}\mathbf 1_{y\gt0}. $$ Now one simply has to identify $2y\max\{y,1/y\}$ for $y$ in $(0,1)$ and for $y$ in $(1,\infty)$.