For complex numbers z, let
f(z) = z^2 if z is real
f(z) = z + 2 if z is not real
Find f(i) + f(1) + f(-1) + f(-i).
Because i is not real, -1 is real, 1 is real, and -i is not real, we have
f(i) + f(1) + f(-1) + f(-i)
= (i+2) +1 +1 +(-i+2)
= 2+1+1+2
=6