Spot the mistake when computing the density function of $Y = 1/X$ when the density function of $X$ is known. The random variable $X$ has density function $f_{X}$ given by
\begin{equation}
 f_{X}(x) = 
\begin{cases} 
\frac{1}{2} \ \ \ \ \ x \in (0,1] \\
\frac{1}{2x^2} \ \ x \in (1,\infty) \\
0 \ \ \ \ \ \ x \in (-\infty,0] 
\end{cases}
\end{equation}
Let $F_{X}$ be the distribution function of $X$. The random variable $Y$ is defined as follows $Y = 1/X$.  I want to compute the density function of $Y$.
Here's my attempt:
Let $y \in \mathbb{R}$ and let $F_{Y}(y)$ be the distribution function of $Y$.
\begin{equation}
F_{Y}(y) = P(Y\leq y) = P(1/X \leq y) = P(1/y \leq X) = P(X \geq 1/y)
\end{equation}
case 1: if $y \in (0,1) \implies  1/y \in (1,\infty) $. Then
\begin{equation}
F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{1}^{1/y} \frac{1}{2x^2} dx = \frac{1+y}{2}
\end{equation}
case 2: if $y \in [1,\infty) \implies  1/y \in (0,1) $. Then
\begin{equation}
F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{0}^{1/y} \frac{1}{2} dx =1-\frac{1}{2y}
\end{equation}
case 3: if $y \in (-\infty,0) \implies  1/y \in (-\infty,0) $. Then
\begin{equation}
F_{Y}(y) = P(X \geq 1/y) = 1 - P(X < 1/y) = 1 - F_{X}(1/y) = 1- \int_{\infty}^{1/y} 0 dx =1
\end{equation}
\begin{equation}
F_{Y}(y) = 
\begin{cases}
1, \ \ \ \ \ \ \ \ \ \ y \in (-\infty,0) \\
\frac{1+y}{2}, \ \ \  \ \ \ \ y \in (0,1) \\
1-\frac{1}{2y},  \ \ \ \  y \in [1,\infty)
\end{cases}
\end{equation}
But the function $F_{Y}(y)$ is not non-decreasing, hence is not a distribution. If $F_{Y}$ were a distribution then it would be easy to compute $f_{Y}$
\begin{equation}
f_{Y}(y) = 
\begin{cases}
0, \ \ \ \ \ \ \ \ \ y \in (-\infty,0) \\
\frac{1}{2}, \ \ \  \ \ \ \ y \in (0,1) \\
\frac{1}{2y^{2}},  \ \ \ \  y \in [1,\infty)
\end{cases}
\end{equation}
questions:

*

*Do you know where I made a mistake?

*Do you know another strategy to compute $f_{Y}$?

Thanks in advance.

A simpler approach is possible via the formula $$f_Y(y) = f_X(g^{-1}(y)) \left|\frac{dg^{-1}}{dy}\right|,$$ where $Y = g(X) = 1/X$, since $g$ is an injective function.  Then since the density of $X$ may be more compactly written as
$$f_X(x) = \frac{1}{2 \max(1, x^2)} \mathbb 1 (x > 0)$$
then for $g^{-1}(y) = 1/y$ we immediately have $$f_Y(y) = \frac{1}{2 \max(1, 1/y^2)} \mathbb 1 (1/y > 0) \cdot \frac{1}{y^2} = \frac{\min(1, y^2)}{2 y^2} \mathbb 1 (0 < y < \infty) = \frac{\min(1/y^2, 1)}{2} \mathbb 1 (0 < y < \infty)$$ which in piecewise form is $$f_Y(y) = \begin{cases} 0, & y < 0 \\ \frac{1}{2}, & 0 \le y \le 1 \\ \frac{1}{2y^2}, & 1 < y < \infty .\end{cases}$$
This shows that $1/X$ has the same distribution as $X$ itself, which makes sense since the conditional distribution $X \mid 0 < X < 1$, and $1/X \mid X > 1$, are both the same uniform distribution.
