If $B^x \equiv B^{2^{2^i}}\ (\textrm{mod}\ N)$, under what conditions must it be true that $(B^x)^x \equiv B^{2^{2^{i+1}}}\ (\textrm{mod}\ N)$?
We can take for granted that $N$ is the product of two large and distinct primes $p$ and $q$, $\gcd(B, N) = 1$, and $B > 1$. What must also be true? Do $p$ and $q$ each have to be safe primes (i.e. they are each the product of 2 and another large prime)? What if $p \equiv q \equiv 3\ (\textrm{mod}\ 4)$? What if $B$ is a quadratic residue $(\textrm{mod}\ N)$, such as $4$?
This is confusing to me, partly because $\gcd(2, \phi(N)) > 1$.
First note the following:
Claim 1: If the equation $A \equiv_N B$ holds [$A,B$ nonnegative integers, $N$ a positive integers] then for any nonnegative integer $y$ so does the equation $A^y \equiv_N B^y$.
Raise then, both sides of the equation by $x$ and use Claim 1 to $$B^x \equiv_N B^{2^{2^i}}$$ to conclude $$(B^x)^x \equiv_N \ \big(B^{2^{2^i}}\big)^x.$$ But then $$\big(B^{2^{2^i}}\big)^x = B^{x\times2^{2^i}} = (B^x)^{2^{2^i}}$$ $$\equiv_N \big(B^{2^{2^i}}\big)^{2^{2^i}} = B^{2^{2^{i}} \times 2^{2^i}} = B^{2^{2^{i+1}}},$$ where the third-to-last last relation $(B^x)^{2^{2^i}} \equiv_N \big(B^{2^{2^i}}\big)^{2^{2^i}}$ follows from the equation $B^x \equiv_N B^{2^{2^{i}}}$ and Claim 1. So in particular, $$\big(B^{2^{2^i}}\big)^x \equiv_N B^{2^{2^{i+1}}}.$$ Thus, concluding: $$(B^x)^x =B^{x^2} \equiv_N \ \big(B^{2^{2^i}}\big)^x \equiv_N B^{2^{2^{i+1}}},$$ or to sum up $$B^{x^2} \equiv_N B^{2^{2^{i+1}}}.$$