When do we have $(z^{\alpha})^{\beta}=z^{\alpha \beta}$? I have to show $(\sqrt{z})^2=z$ in $\mathbb{C}$.
Using the principal branch cut, we have $\sqrt{z}.\sqrt{z}=e^{\frac{1}{2}\ln|z| + i Arg{z} }.e^{\frac{1}{2}\ln|z| + i Arg{z} }=e^{\ln|z| + i Arg{z} }=z$ in $\mathbb{C^{*}}=\mathbb{C} \setminus \{x:x\leq 0\}$. Now, as $(\sqrt{z})^2$ and $z$ agree on $\mathbb{C^{*}}$, and $g(z)=z$ is entire, we have an anlaytical extension of $(\sqrt{z})^2$ by $g(z)=z$.
Q1. Does this suffice? $\textbf{By $(\sqrt{z})^2=z$ in $\mathbb{C}$, do we mean $z$ is an analytical extension of $(\sqrt{z})^2$?}$
Q2. Do we have a necessary and sufficient condition to write $(z^{\alpha})^{\beta}=z^{\alpha \beta}$? for real numbers $\alpha$, $\beta$ ? I would like to avoid pitfalls like $(i^4)^{1/2}=1^{\frac{1}{2}}$ and $(i^4)^{1/2}=i^{\frac{4}{2}}=-1$. One does get an equality here by defining $1^{\frac{1}{2}}=-1$.
 A: $\left[\sqrt{z}\right]^2$ must equal $z$, regardless of which branch is used to compute $\sqrt{z}$.  This is because of what $\sqrt{z}$ actually signifies.
By definition, $\sqrt{z}$ signifies any number $w$ such that $w^2 = z.$
Contrast this with (for example) $\sqrt{z^2}$, which will not equal $z$ if the principal branch cut is used (i.e. 1st and 4th quadrants), and if $z$ happens to be in the 3rd quadrant.
Consider also $\left[\sqrt{z}\right]^3$, whose value depends on which branch is taken for $\sqrt{z}$.
For example, if $z = -1$, then either $(+i)$ or $(-i)$ may be construed as $\sqrt{-1}$ in the absence of a convention specifying the principal branch.
Then, you have that although $(+i)^2 = (-i)^2$, it is not the case that $(+i)^3 = (-i)^3.$
So, one rule that can be established is that $(z^a)^b = z^{ab}$, regardless of which branch is taken for $(z^a)$ whenever both of the following constraints are satisfied:

*

*$b$ is an integer

*$ab = 1.$
In fact, the 2nd constraint above can be relaxed in the following (somewhat convoluted way).
If both of the conditions above are satisfied, and if $c$ is an integer (positive, negative, or zero), then you have that
$\left[\left(z^a\right)^b\right]^c = z^{abc}$, regardless of which branch is taken for $(z)^a.$
A: We define complex exponentiation $$z^\omega = \exp(\omega\ln|z| + i\omega\operatorname{arg}(z))$$
subject to a choice of branch of the argument function $\operatorname{arg}$.
Additionally, it's a common exercise to show that $\exp((n+m)z) = \exp(nz)\exp(mz)$ for any complex $z$ and natural numbers $n,m$, which when combined with $\exp(0)=1$ can be used to show $\exp(z)^n = \exp(nz)$ for any complex $z$ and integer $n$.
Putting all of the above together, we find that for any complex $z,\alpha$ and integer $n$,
$$(z^\alpha)^n = \exp(\alpha\ln|z|+i\alpha\operatorname{arg}(z))^n = \exp(\alpha n\ln|z| + i\alpha n\operatorname{arg}(z)) = z^{\alpha n}.$$
That is, to half-answer the question in the title, we will have $(z^\alpha)^\beta = z^{\alpha\beta}$ when $\beta$ is an integer.
When $\beta$ is not an integer, it's much messier as equality may hold or not depending on the choice of branch.  For an arbitrary branch, I don't know of a simple test that will give a necessary and sufficient condition more simple than just evaluating both of $(z^\alpha)^\beta$ and $z^{\alpha\beta}$ and seeing if they're equal.
