Define a function f on the set of integers by:
f(n) = n - 1 if n is even
f(n) = n^2 - 1 if n is odd.
Find all integers n such that f(f(n)) = 8.