TITLE: what is domain of $f(x)=(-1)^x$
QUESTION [5 upvotes]: What exactly is the domain of the $$f(x)=(-1)^x$$
Because if $x=\pm0.5$ or $x=\pm0.25$ etc we get imaginary numbers.
But if we take $x=\pm\frac{1}{3}$ we get a real number, so how to define its domain? 
Do we restrict it to only integers?

REPLY [7 votes]: There is no problem in defining such a function over the rational numbers that can be represented with an odd denominator. However such a function will not obey the standard rules for exponentials:
$$
(-1)^{1/3}=-1
$$
but, on the other hand,
$$
((-1)^{2/1})^{1/6}=1
$$
The usefulness of such a function is unclear.
However, you can define it as a multivalued function over the complex numbers, using the fact that $-1=e^{i\pi+2ki\pi}$ ($k$ any integer)
$$
(-1)^x=e^{(2k+1)ix\pi}
$$
Note that in general this will have infinitely many values, unless $x$ is rational. If $x$ is rational and $x=a/b$, with odd $b$, then only one of the values will be real and, conversely, if one of the values is real, then $x$ is rational and $x=a/b$ with odd $b$. (Exercise on complex numbers.)