Let $Y$ be such a random variable, that :
$Y = \begin{cases} 1, & \mbox{if } X \le 1/2 \\ X, & \mbox{if } X>1/2 \end{cases}$
where $X$ has uniform distribution on $[0,1]$.
My solution:
$F_Y(t)=P(Y \le t) = P(1 \le t, X \le1/2)+P(X \le t, X>1/2)=1/2P(1 \le t)+1/2 F_X(t)$.
So, CDF of $Y$:
$F_y(t) = \begin{cases} 0, & \mbox{if } t <0 \\ 1/2 \cdot t, & \mbox{if } t \in [0,1) \\ 1, & \mbox{if } t \ge 1 \end{cases}$
PDF of $Y$ :
$f_y(t) = \begin{cases} 0, & \mbox{if } t <0 \wedge t\ge 1 \\ 1/2 , & \mbox{if } t \in [0,1) \end{cases}$
$E(Y)= \int_{0}^{1}\frac{1}{2}\cdot y dy$
I know, how to finish it, if the above is correct.