Show that the test always terminates $p_0(\mathbf{x})$ and $p_1(\mathbf{x})$ are two distinct density functions on $R^d$.
$E_i, i \in \{0,1\}$ is the expectation when density of $\mathbf{X}$ is $p_i(\mathbf{x})$ 
$L_n = \frac{\prod_{i=1}^n p_1(X_i)}{\prod_{i=1}^n  p_0(X_i)}$
Let $\mathbf{X_1}, \mathbf{X_2} \dots$ be an infinite sequnce of observatiions i.i.d with density $p$ observed one at a time. Consider a test which after $n$ observations rejects $H_0: p = p_0$ if $\log L_n >b$ or accepts $H_1: p = p_1$ if $\log L_n < a$ otherwise takes an additional observation. Show that the test always terminates.
Attempt
Consider $a < \log L_n < b$, then $\log L_{n+1} = \log L_n + \log(\frac{p_1(\mathbf{X_{n+1}})}{p_0(\mathbf{X_{n}})})$
$E_0 \log(\frac{p_1(\mathbf{X}}{p_0(\mathbf{X})})$ can be proved to be $< 0$
$ a < E \log L_n < b$
 A: Applying a logarithm, and dividing by $n$,
$$
\frac{\log\left(L_n\right)}{n} = 
\frac{\log\left( \frac{\prod_{i=1}^n p_1(X_i)}{\prod_{i=1}^n  p_0(X_i)}\right)}{n}
=
\frac{\sum_{i=1}^n \log\left( \frac{p_1(X_i)}{p_0(X_i)} \right)}{n}
.
$$
As $n$ grows large, by the LLN, this approaches $$
\mathbf{E}\left[\log\left( \frac{p_1(X_i)}{p_0(X_i)} \right)\right]
$$ (although, formally, you would need to ascertain the LLN conditions).
Suppose the true distribution (the one over which the expectation is taken) is $p_1$. Then this is exactly the Kullback-Leibler divergence $D(p_1 || p_0) \gneq 0$ (as the question states the distributions are distinct). Conversely, if the alternative is true, then this is $-D(p_0 || p_1) \lneq 0$.
Note that this is $\frac{\log\left(L_n\right)}{n}$, i.e., the criteria divided by $n$; the original question did not divide this by $n$. You should be able to complete the answer from here.
A: Let $\{X_i\}_{i\geq 1}$ be a sequence of independent and identically distributed random variables, such that $X_1$ has density $p$.
Define the likelihood ratio
$$
  R_n = \prod_{i=1}^n \frac{p_1(X_i)}{p_0(X_i)}.
$$
For some real numbers $\ell_0$ and $\ell_1$, with $\ell_0<\ell_1$, define the following sequential test procedure.
If $\log R_n\leq\ell_0$ we accept $H_0:p=p_0$; else if $\log R_n\geq\ell_1$ we accept $H_1:p=p_1$; otherwise we keep sampling until one of the former conditions is met.
Let $P_0$ and $\mathbb{E}_0$ denote the probability measure and expectation under $H_0$, and let $P_1$ and $\mathbb{E}_1$ denote the probability measure and expectation under $H_1$. Using Jensen's inequality, we have
$$
  \mathbb{E}_0\!\left[\log\frac{p_1(X_1)}{p_0(X_1)}\right]<\log\left( \mathbb{E}_0\!\left[\frac{p_1(X_1)}{p_0(X_1)}\right]\right) = \log\left(\int \frac{p_1(t)}{p_0(t)}\,p_0(t)dt\right)=0.
$$
Similarly,
$$
\mathbb{E}_1\!\left[\log\frac{p_1(X_1)}{p_0(X_1)}\right] = -\mathbb{E}_1\!\left[\log\frac{p_0(X_1)}{p_1(X_1)}\right]>0.
$$
The inequalities are strict because $-\log$ is strictly convex on $(0,\infty)$.
By the strong law of large numbers, we have
$$
  \frac{1}{n} \log R_n = \frac{1}{n} \sum_{i=1}^n \log \frac{p_0(X_i)}{p_1(X_i)} \to \mathbb{E}_0\!\left[\log\frac{p_1(X_1)}{p_0(X_1)}\right]<0 \quad\text{a.s.}\quad [P_0].  
$$
Therefore, $\log R_n\to-\infty$ a.s. $[P_0]$. Similarly, we have $\log R_n\to\infty$ a.s. $[P_1]$.
Define the stopping time
$$
  T = \min\,\{n\geq 1:\log R_n\leq \ell_0 \text{ or } \log R_n \geq  \ell_1\}.
$$
If the stopping time $T$ is not finite, then $T>n$, for every $n\geq 1$. But $T>n$ implies that $\log R_n>\ell_0$ and $\log R_n<\ell_1$. Hence,
$$
  P_0(T=\infty) \leq P_0(T>n) \leq P_0(\log R_n>\ell_0 \text{ and } \log R_n<\ell_1) \leq P_0(\log R_n>\ell_0) \to 0.
$$
Also,
$$
  P_1(T=\infty) \leq P_1(T>n) \leq P_1(\log R_n>\ell_0 \text{ and } \log R_n<\ell_1) \leq P_1(\log R_n<\ell_1) \to 0.
$$
The result follows.
