  We study two problems. The first one is the similarity problem for the
indefinite Sturm-Liouville operator \[ A=-(\sgn\, x)\frac{d}{wdx}\frac{d}{rdx}
\] acting in $L^2_{w}(-b,b)$. It is assumed that $w,r\in L^1_{\loc}(-b,b)$ are
even and positive a.e. on $(-b,b)$.
  The second object is the so-called HELP inequality
\[(\int_{0}^b\frac{1}{\tilde{r}}|f'|\, dx)^2 \le K^2
\int_{0}^b|f|^2\tilde{w}\,dx\int_{0}^b\Big|\frac{1}{\tilde{w}}\big(\frac{1}{\tilde{r}}f'\big)'\Big|^2\tilde{w}\,
dx, \] where the coefficients $\tilde{w},\tilde{r}\in L^1_{\loc}[0,b)$ are
positive a.e. on $(0,b)$.
  Both problems are well understood when the corresponding Sturm-Liouville
differential expression is regular. The main objective of the present paper is
to give criteria for both the validity of the HELP inequality and the
similarity to a self-adjoint operator in the singular case. Namely, we
establish new criteria formulated in terms of the behavior of the corresponding
Weyl-Titchmarsh $m$-functions at 0 and at $\infty$. As a biproduct of this
result we show that both problems are closely connected. Namely, the operator
$A$ is similar to a self-adjoint one precisely if the HELP inequality with
$\tilde{w}=r$ and $\tilde{r}=w$ is valid.
  Next we characterize the behavior of $m$-functions in terms of coefficients
and then these results enable us to reformulate the obtained criteria in terms
of coefficients. Finally, we apply these results for the study of the two-way
diffusion equation, also known as the time-independent Fokker-Plank equation.
