Step 1 (i): Work done bringing a unit positive test charge from infinity to distance $r$ from $Q$: $V = \int_\infty^r -\vec E\cdot d\vec r = \dfrac{kQ}{r}$ (using $E=kQ/r^2$ radially, standard integration gives): $V=\dfrac{1}{4\pi\varepsilon_0}\dfrac{Q}{r}$.
Step 2 (ii): Total energy = mutual PE between the two charges + PE of each charge due to external field.
Step 3: Distance between charges: $6-(-3)=9$cm$=0.09$m. Mutual PE: $U_{12} = \dfrac{kq_1q_2}{r} = \dfrac{9\times10^9\times10\times10^{-6}\times(-5\times10^{-6})}{0.09} = \dfrac{-4.5\times10^{-1}}{0.09} \times 10^{0}$; let's compute: $9\times10^9\times10\times10^{-6}\times5\times10^{-6}=9\times10^9\times50\times10^{-12}=450\times10^{-3}=0.45$; with negative sign: $-0.45/0.09=-5$ J.
Step 4: PE of $q_1$ in external field: $U_1 = q_1V_{ext}(r_1)$, where $V_{ext} = \int E\,dr = \int A/r^2\,dr = -A/r$ (taking reference appropriately, or using potential due to field $E=A/r^2$, $V=A/r$ by convention matching the field form, i.e. $V(r) = A/r$ so that $E=-dV/dr = A/r^2$). At $r_1=3$cm$=0.03$m (magnitude): $V_1 = A/r_1 = 1.8\times10^5/0.03=6\times10^6$ V. $U_1 = 10\times10^{-6}\times6\times10^6=60$ J.
Step 5: At $r_2=6$cm$=0.06$m: $V_2=A/r_2=1.8\times10^5/0.06=3\times10^6$V. $U_2 = -5\times10^{-6}\times3\times10^6=-15$ J.
Step 6: Total energy $=U_{12}+U_1+U_2 = -5+60-15=40$ J.