This was a quiz question that I answered but don't understand something that is probably very important.
Question:
Let $Y \sim \mathrm{Uniform}(0,1)$ and $[X|Y=y] \sim \mathrm{Uniform}(0,1/y).$ Find $f_X(x)$.
Solution (Attempt):
We have $f_X(x|y) = y$ for $y \in (0,1)$ and $x \in (0,1/y)$.
Then,
$f_X(x) = \int_{-\infty}^\infty f_X(x|y) \cdot f_Y(y) \mathrm{d}y = \int_0^1 y \mathrm{d}y = \frac{1}{2}.$
From here I argued that we need $\int_{-\infty}^\infty f_X(x) \mathrm{d}x = 1$
so $X \sim \mathrm{Uniform}(0,2)$ will satisfy this condition.
However, my professor has noted that
$f_X(x) = \frac{1}{2}$
for $x \in [0,1]$ but I did not cover the case of $x > 1$ in which she then goes on to do the following:
$f_X(x) = \int_{0}^{ 1/x } y \mathrm{d}y = \frac{1}{2x^2}$ for $x > 1$.
Trying to understand this, it makes me think that the former case that I did, was just for the case of $y = 1$ and then the part that professor did was for $y \in (0,1).$ But that isn't making that much sense as it seems then the integral I computed would have just been $1$. I am guessing something is happening where $X$ is distributed on some interval $(0,1/y)$ which ends at $1/y$ which varies and could be a large number.