We all know that $e^{\pi i}=\cos \pi + i \sin \pi=-1$, and that ${(x^a)}^b=x^{a \times b}$, also $e^{2 \pi i}=\cos {2\pi} + i \sin {2\pi}=1$.
Here's my problem, we have $a \in \mathbb R$, and I want to find value (or set of possible values) of $e^{2a\pi i}$, so I followed these steps: $$e^{2a\pi i}={(e^{2 \pi i})}^a=1^a=1$$ By using the exponential identity ${(x^a)}^b=x^{ab}$ and knowing that $1^x=1:x \in \mathbb C$, I ended up with $100$% possibility that $e^{2a\pi i}=1$, But by following different steps I got something else: $$e^{2a\pi i}={(e^{\pi i})}^{2a}=(-1)^{2a}$$ And I ended up with two possibilities: $$\text{if} \ a \in \mathbb Z \implies (-1)^{2a}=1 \\ \text{if} \ a \notin \mathbb Z \implies (-1)^{2a} \ne 1$$
So, I suppose there's something wrong in my steps, even after checking all the laws and identities used my steps seemed to be right, so if you you caught the mistake or have an explanation please write it down below because this problem is driving me crazy !
Note: I tried using Wolframalpha and Geogebra to check if this rule apply to complex numbers, and I got the same result for $(e^i)^\pi=(e^\pi)^i$. Also I'm seeking a deductive proof, references are preferred to be mentioned.
Note that the identity $(x^a)^b = x^{ab}$ already fails in the real numbers: Take $x=-1$, $a=2$, $b=1/2$. Then: $$(x^a)^b = ((-1)^2)^{1/2} = 1^{1/2} = \sqrt{1} = 1$$ but $$x^{ab} = (-1)^{2(1/2)} = (-1)^1 = -1$$ Note however that the rule does hold if both $a$ and $b$ are integers (and, if any of them is not positive, $x\ne 0$, as otherwise the powers are not defined at all). Moreover, with the usual definition, it also holds if $x$ is a positive real number.
The root of the problem (no pun intended) is that the equation $x^a=1$ in general has more than one solution, and in the complex numbers there is no choice that fulfils all desired properties.
This can be seen most easily when writing the complex number in polar form, $x = r \mathrm e^{\mathrm i\phi}$. Then the most obvious value for $x^a$ would be $r^a \mathrm e^{\mathrm i a\phi}$. However consider the case $a=1/2$. If $x$ goes around the origin once along the unit circle, $x^{1/2}$, starting at $1$, goes just half that circle. At the end, it ends up at the other root of the equation $x^2=1$, namely $-1$. Only after another full circle the square root returns to $1$.
But a function can only have one value. Therefore we have to make a choice. In the real numbers that's unproblematic, as we only have square roots of positive numbers, and thus it's no problem to just use the root positive. But in the complex numbers, as seen above, we can continuously move the root from one solution to another. Thus we have no choice but to add some discontinuity, called a Riemann cut.
The most common choice it to make the cut right below the negative real line. That is, we choose the angle of the polar coordinates of $x$ before applying the exponential to be in the interval $(-\pi,\pi]$.
Now let's look at your example:
To calculate $\mathrm (e^{2\pi\mathrm i})^a$ with real $a$, we first have to correct the imaginary part of the base (the inner exponential) to lie in the interval $(-\pi,\pi]$ by adjusting its exponent by an appropriate multiple of $2\pi\mathrm i$ (which of course does not change the value of the base, as $\mathrm e^{2\pi\mathrm i}=1$). Obviously the correct adjustment is to subtract $2\pi\mathrm i$ from that exponent, which makes it $0\in (-\pi,\pi]$. Only now can we apply the exponential rule, to find that $(\mathrm e^0)^a = \mathrm e^{0a} = 1$.
On the other hand, unless $a$ is an integer, altering the exponent of $\mathrm e^{2\pi a\mathrm i}$ by a multiple of $2\pi\mathrm i$ will never give $0$, and thus the result will not be $1$.
We can also look at my real numbers example in the light of complex numbers.
In polar coordinates, we have $\mathrm i = \mathrm e^{\pi\mathrm i}$, where $\pi\in(-\pi,\pi]$.
Now let's first calculate $((-1)^2)^{1/2}$ the “complex way”:
We start by inserting: $$((-1)^2)^{1/2} = ((\mathrm e^{\pi\mathrm i})^2)^{1/2}.$$ Now for the inner exponential, since I already chose the exponent in the right interval, no adjustment is needed, and thus we can just apply the rule: $$((\mathrm e^{\pi\mathrm i})^2)^{1/2} = (\mathrm e^{2\pi\mathrm i})^2.$$
However now through the multiplication we moved outside the valid interval, therefore now we have to adjust the exponent, as before, before applying the exponential rule again: $$(\mathrm e^{2\pi\mathrm i})^2 = (\mathrm e^{2\pi\mathrm i-2\pi\mathrm i})^2 = (\mathrm e^0)^2 = \mathrm e^{0\cdot 2}=\mathrm e^0 = 1.$$
So just as before, we find that $((-1)^2)^{1/2}=1$.
On the other hand, we have $$(-1)^{2(1/2)} = (\mathrm e^{\pi\mathrm i})^{2(1/2)} = (\mathrm e^{\pi\mathrm i})^1$$ and since now the exponent is already in the right range, we don't have to adjust it, and thus can simply continue: $$(\mathrm e^{\pi\mathrm i})^1 = \mathrm e^{\pi\mathrm i\cdot 1} = \mathrm e^{\pi\mathrm i} = -1$$ So as before, we find $(-1)^{2(1/2)} = -1$.
But unlike before, we see also why this is the case: It is the case because our definition of the complex exponential function required us to adjust the angle in the first case, but not in the second case. And we defined the exponential function in that way because otherwise we would have ended up with a multivalued “function” which isn't a proper function any more. And the ultimate reason for that is the fact that $x^a=1$ in general has more than one solution.