$X$ is the random variable input, and is uniform on $X$ is the random variable input, and is uniform on $[−20, 20]$. This is input to an “amplitude limiter”, whose output, a new random variable $Y$, relates to the input $X$ as follows:
$$
Y=
\begin{cases}
-5, \quad x\leq -5,\\
x,\quad x\in [-5,5],\\
5,\quad x\geq 5
\end{cases}
$$
1) Plot the PDF of $X$ and $Y$.
2) Find $E[X]$ and $E[Y]$.
3) Find $E[X^2]$ and $E[Y^2]$.
4) Find the distribution of $Y$ conditioned on $B=\{|x|<1\}$.
This is what I have tried to solve so far:
1) The PDF of $X$
$$
=\begin{cases}
\tfrac{1}{40},\quad   -20<x<20,\\
0,\qquad \text{otherwise}.
\end{cases}
$$
CDF of X
 A: I will finish number 1 and give hints on the rest.


*

*You correctly determined $\rho_X\left(x\right) = 1/40$ for $\left|x\right| \le 20$, and $0$ otherwise. The pdf for $Y$ is more complicated. For $\left|Y\right| < 5$, each value of $X$ corresponds to only one value of $Y$. So, for $\left|y\right| < 5$, $\rho_Y\left(y\right) = \rho_X\left(y\right) = 1/40$. At $Y = -5$, infinitely many values of $X$, from $-20$ to $-5$, correspond to a single value of $Y$. In other words, the integral of $\rho_Y\left(y\right)$ over an infinitesimally small interval around $y = -5$ must yield a finite number, namely the integral of $\rho_X\left(x\right)$ from $-20$ to $-5$, or $15/40 = 3/8$. The same goes for $Y = 5$. Both of these points must be represented using Dirac delta functions:
$$
\rho_Y\left(y\right) = \frac{1}{40} + \frac{3}{8} \left[ \delta\left(y+5\right) + \delta\left(y-5\right)\right]
$$
for $\left|y\right| \le 5$, and $0$ otherwise.

*Compute
$$
E\left[X\right] = \int_{-\infty}^{\infty} dx \ x \ \rho_X\left(x\right)
$$
and
$$
E\left[Y\right] = \int_{-\infty}^{\infty} dy \ y \ \rho_Y\left(y\right),
$$
remembering that $\int_{-\infty}^{\infty} dx \ f\left(x\right) \delta\left(x-a\right) = f\left(a\right)$.

*Compute
$$
E\left[X^2\right] = \int_{-\infty}^{\infty} dx \ x^2 \ \rho_X\left(x\right)
$$
and
$$
E\left[Y^2\right] = \int_{-\infty}^{\infty} dy \ y^2 \ \rho_Y\left(y\right).
$$

*If $\left| X \right| < 1$, then each $X$ value corresponds to only one $Y$ value. So, since $X$ is uniformly distributed, $Y$ is uniformly distributed (constant) on $-1 < y < 1$.

