For all complex numbers $z$, let
\[f(z) = \left\{
\begin{array}{cl}
z^{2}&\text{ if }z\text{ is not real}, \\
-z^2 &\text{ if }z\text{ is real}.
\end{array}
\right.\]
Find $f(f(f(f(1+i))))$
We use the rule of at each step
f(f(f(f(1 + i))))
= f(f(f(2 + 2i)))
= f(f(-8i))
= f(64)
= -4096.
f(1+i) = (1+i)^2 = 1 + 2i + i^2 = 2i
f(2i) =( 2i)^2 = -4
f(-4) = - ( -4^2) = -16
f(-16) = - (-16)^2 = - 256