A simple conditional expectation problem $X, Y$ iid uniform random variables on $[0,1]$
$$Z =
\left\{
\begin{aligned}
X+Y \quad&\text{ if }  X>\frac{1}{2}
\\
\frac{1}{2} + Y \quad & \text{ if } X\leq\frac{1}{2}
\end{aligned}
\right.$$
The question is $E\{Z|Z\leq 1\}= ?$
I tried $\displaystyle \int_0^1 E\{Z|Z = z\} P\{Z = z\}dz$ and got $5/8$, but I am not so sure about the result since I haven't touched probability for years.

Your probability space is the unit square in the $(x,y)$-plane with $dP={\rm d}(x,y)$. The payout $Z$ is ${1\over 2}+y$ in the left half $L$ of the square and $x+y$ in the right half $R$. The region  where $Z\leq 1$ consists of the lower half of $L$ and a triangle in the lower left of $R$; it has  total area $P(Z\leq 1)={3\over8}$.
It follows that the expectation $E:=E[Z\ |\ Z\leq 1]$ is given by
$$E=\left(\int_0^{1/2}\int_0^{1/2}\bigl({1\over2}+y\bigr)dy dx + \int_{1/2}^1\int_0^{1-x}(x+y)dy dx\right)\Bigg/{3\over8} ={{3\over16}+{5\over48}\over{3\over8}}={7\over9}\ .$$
