The length of the piece that contains p is:

l = u if p<u (the piece (0,u) is chosen)

l = 1-u if p>u (the piece (u,1) is chosen)

So the length of the chosen stick as a function of u is:

l(u) = u if u>p

l(u) = 1-u if u<p

and the expected value of l(u) is:

To evaluate the integral, you need to split it up:

Post again if you're still having trouble.