The question asks to prove that for any two Arithmetic sets $A$ and $B$ there are sentences $X$ and $Y$ such that $X$ is true iff $A$ contains the Godel number of $Y$, and $Y$ is true iff $B$ contains the Godel number of $X$.
Since $A$ is arithmetic there is a predicate $F_A(v_1)$ that expresses $A$ and an predicate $H_A(v_1)$ that expresses $A^{\ast} := \left\{m \in \mathbb{N} : d(m)\in A\right\}$, where $d(m)$ is the diagonal of the Godel number $m$. Then, if $h_A$ is the Godel number of $H_A$, then $H_A(h_A)$ is a sentences that is true iff the $A$ contains Godel number of $H_A(h_A)$. I can't figure out how to cross-reference: finding $X$ that asserts the Godel number of $Y$ is in $A$ and finding $Y$ that asserts the Godel number of $X$ is in $B$. Any help is appreciated.
I believe the following proof will work:
Let $H_A$ be a predicate that expresses $A^{\ast}$ and $H_B$ a predicate that expresses $B^{\ast}$. Define $X_1:=H_A\left(\overline{g(H_B(\overline{v_1}))}\right)$, $X:=X_1\left[\overline{g(X_1)}\right]$, and $Y:=H_B\left(\overline{g(X_1)}\right)\left[\overline{g(H_B(\overline{g(X_1)})})\right]$.
Now, $X$ is true iff $X_1\left(\overline{g(X_1)}\right)$ is true iff $H_A\left(\overline{g(H_B(\overline{g(X_1)}))}\right)$ is true iff $g\left( H_B(\overline{g(X_1)})\left[\overline{g(H_B(\overline{g(X_1)})}\right]\right)\in A$ iff $g(Y)\in A$.
And, $Y$ is true iff $H_B(\overline{g(X_1)})$ is true iff $g\left(X_1\left[\overline{g(X_1)}\right]\right)\in B$ iff $g(X)\in B$.