Behavior of $f(x)=(-1)^x$ 
For what $x$ is $f(x)=(-1)^x$ a real number, and when is it a complex number?

When I graph it online, the graph glitches out and has points all over the place.

When $-1$ is raised to power of $x$ the complex number so formed has a real part $\cos \pi x $  and imaginary part  $\sin \pi x.$ This can be found using Euler formula $ e^{i \pi}=-1$. The two parts are graphed below .. with each part having a period or wave length  $\lambda=2, $ the roots are at $x=..,-2,-1,0,1,2,...$ etc.
Real part vanishes for all integer values of $x$ as is obvious from graph and direct check by plugin.
The $f(x)$ thus is always complex for all real values of $x$
Again for complex $x= a+ib ,\, f(x) $ is complex.

