z = x+i y
z(with line on top) = x-i y
let z = a+bi
then z* (i am writing z* for z-conjugate, rather than ) to avoid extra typing. so i'm lazy. sue me.) is a-bi.
now z+z* = (a+bi) + (a-bi) = (a+a) + (b-b)i = 2a + 0i = 2a, so (z+z*)/2 = a = Re(z).
and: z-z* = (a+bi) - (a-bi) = (a-a) + (b-(-b))i = 0 + 2bi = 2bi, so (z-z*)/(2i) = 2bi/(2i) = b = Im(z).