Let $(E,\mathcal E)$ be a measurable space, $\mu$ and $\nu$ be probability measures on $(E,\mathcal E)$ and $$\chi^2(\nu,\mu):=\begin{cases}\displaystyle\mu\left|\frac{{\rm d}\nu}{{\rm d}\mu}-1\right|^2=\mu\left|\frac{{\rm d}\nu}{{\rm d}\mu}\right|^2-1&\text{, if }\nu\ll\mu\\\infty&\text{, otherwise}\end{cases}$$ denote the $\chi^2$-distance of $\mu$ and $\nu$.
I want to show that $$\chi^2(\nu,\mu)=\sup_f\left|\int f\:{\rm d}(\nu-\mu)\right|^2,\tag1$$ where the supremum is taken over all bounded $\mathcal E$-measurable $f:E\to\mathbb R$ with $\left\|f\right\|_{L^2(\mu)}\le1$.
The case $\nu\not\ll\mu$ is clear to me. So, assume $\nu\ll\mu$ and let $$\varrho:=\frac{{\rm d}\nu}{{\rm d}\mu}.$$ I think we need to distinguish the cases $\varrho\in L^2(\mu)$ and $\varrho\not\in L^2(\mu)$. If $\varrho\in L^2(\mu)$, then $${\chi^2(\nu,\mu)}^{\frac12}=\left\|\varrho-1\right\|_{L^2(\mu)}=\sup_{\substack{f\in L^2(\mu)\\\left\|f\right\|_{L^2(\mu)}\le1}}|\langle\varrho-1,f\rangle_{L^2(\mu)}|\tag2$$ as this is true for any Hilbert space.
How can we conclude from $(2)$? I guess we need to argue with the density of bounded $\mathcal E$-measurable $f:E\to\mathbb R$ in $L^2(\mu)$.
And how can we show the claim in the case $\varrho\not\in L^2(\mu)$, where we've clearly got $\chi^2(\nu,\mu)=\infty$?