(x+1) is a factor of xn + 1 only if
n is an odd integer
∴ (x+1) is a factor of xn + 1
Let x + 1 = 0, then x =-1
∴ f(x) = xn + 1
and f(-1) =(−1)n + 1
But (−1)n is positive if n is an even integer and negative if n is an odd integer
and (−1)n + 1 = 0
{∵ x + 1 is a factor of f(x)}
∴(−1)n must be negative
∴ n is an odd integer