I'll try building formal proof let me know how it is.
Case 1: Both $i,j$ are prime(different) numbers: In that case $gcd(i,j)=1$ and hence $\delta(q,z)=q$
Given that $\delta(q,z^i)=\delta(q,z^j)=q$ for $i,j \gt 0$ is true.
Case 2: One of $i\,orj$ is prime and other one is a composite number. In this case $gcd(i,j)=i\,or\,j$ depending whether $i$ is prime or $j$ is prime.
Suppose it was like $gcd(i,j)=i$ then $\delta(q,z^i)=q$ holds as $\delta(q,z^i)=\delta(q,z^j)=q$ is true for $i,j \gt 0$
Case 3: Suppose both $i,j$ are composite numbers and let $gcd(i,j)=k$
given $\delta(q,z^i)=\delta(q,z^j)=q$ holds. I can re-write it as
$\delta(q,z^{i-k}.z^k)=\delta(q,z^{j-k}.z^k)=q$...(A) also holds. for some $z^k$
Using right-invariance property which states that if for two different strings $x,y$ if $\delta(q,x)=\delta(q,y)$, then for some string $z$ in the same input alphabet,$\delta(q,xz)=\delta(q,yz)$
So, by the same property
$\delta(q,z^{i-k})=\delta(q,z^{j-k})=q$
From result (A) it is not too hard to see that $\delta(q,z^k)=q$ where $k=gcd(i,j)$
Let me know if the proof is correct.