<s>[INST] How to find the probability density function of the random variable $\frac{1}{X}$? How to find the probability density function of the random variable $\frac{1}{X}$?
Let $X$ be a random variable with pdf
$f_X(x)= \begin{cases} 0 ; x \le 0 \\ \frac{1}{2} ; 0 < x \le 1 \\ \frac{1}{2x^2} ; 1 < x < \infty \end{cases}$
I was trying to avoid using  formula. So we see that
$P(Y \le y) = 1 - P(X \le y)$
Case$1$: if $y \le 0$
Then $F(y) = 1 - P[X \le y] = 1$
Case $2:$ if $0 < y \le 1$
Then $F(y) = 1 - P(X \le y) =  1 - (0 + \int_{0}^{y}\frac{1}{2}dy) = 1-\frac{y}{2}$
Case $3:$ if $1 < y < \infty$
Then $F(y) = 1 - P(X \le y) =  1 - (\frac{1}{2} + \int_{1}^{y}\frac{1}{y^2}dy) = \frac{1}{2}+\frac{1}{y}-1$
Then on differentiating we can get the probability density function.
I thibk that the distribution function that i got is not correct . Can someone help me out please
 [/INST] $X$ is  a positive r.v. and so is $Y$. Hence, $P(Y\leq y)=0$ for $y \leq 0$.
Also, $P(Y \leq y)=\frac  y 2$ for $0<y \leq 1$ and $P(Y \leq y)=1-\frac 1  {2y}$ for $y >1$.
[For $0<y\leq 1$ we have $P(Y \leq y)=P(\frac 1  X \leq y)=P(X\geq \frac 1  y)=\int_{1/y}^{\infty} \frac 1 {2x^{2}}dx=\frac  y 2$. I will leave the case $y>1$ to you].
</s>