Solution (source code)

= Solution

Let $\theta:H\wr G\to Q$ be any homomorphism to a finite group. Because $G$ is infinite, two distinct elements $r,s\in G$ have $\theta(r)=\theta(s)$. For $h\in H$, denote by $h_g$ the lamp with value $h$ at $g$. Conjugation translates lamps, so
$$
\theta(h_r)=\theta(h_s)
$$
for every $h\in H$. Choose $h,k\in H$ with $[h,k]\ne1$. Lamps at different coordinates commute, and therefore
$$
\theta([h_r,k_r])
=\theta([h_s,k_r])=1.
$$
But $[h_r,k_r]$ is the nonidentity lamp $[h,k]_r$. This same nonidentity element is killed by every finite quotient, so $H\wr G$ is not residually finite.