Difficulty in understanding a part in a proof from Stein and Shakarchi Fourier Analysis book. 
Theorem 2.1 : Suppose that $f$ is an integrable function on the circle with $\hat f(n)=0$ for all $n \in \Bbb Z$. Then $f(\theta_0)=0$ whenever $f$ is continuous at the point $\theta_0$.
Proof : We suppose first that $f$ is real-valued, and argue by contradiction. Assume, without loss of generality, that $f$ is defined on $[-\pi,\pi]$, that $\theta_0=0$, and $f(0) \gt 0$.
Since $f$ is continuous at $0$, we can choose $ 0\lt \delta \le \frac \pi2$, so that $f(\theta) \gt \frac {f(0)}2$ whenever $|\theta| \lt \delta$. Let $$p(\theta)=\epsilon + \cos\theta,$$
  Where $\epsilon \gt 0$ is chosen so small that $|p(\theta)| \lt 1 - \frac \epsilon2$, whenever $\delta \le |\theta| \le \pi$. Then, choose a positive $\eta$ with $\eta \lt \delta$, so that $p(\theta) \ge 1 + \frac \epsilon2$, for $|\theta| \lt \eta$. Finally, let $p_k(\theta)=|p(\theta)|^k$, and select $B$ so that $|f(\theta)| \le B$ for all $\theta$. This is possible since $f$ is integrable, hence bounded.
By construction, each $p_k$ is a trigonometric polynomial, and since $\hat f(n)=$ for all $n$, we must have $\int_{-\pi}^{\pi} f(\theta)p_k(\theta)\,d\theta=0$ for all $k$.

I understood the first paragraph clearly. But the rest is not making it's way into my head.


*

*In the beginning of second paragraph, how does the given range works for choosing $\delta$? If the continuity is used to get the range, then how?

*How can we choose $\epsilon$ so small such that, $|p(\theta)| \lt 1 - \frac \epsilon2$, whenever $\delta \le |\theta| \le \pi$?

*How can we choose positive $\eta$ with $\eta \lt \delta$, so that $p(\theta) \ge 1+ \frac \epsilon2$, for $|\theta| \lt \eta$.

*Why do we must have $\int_{-\pi}^{\pi}f(\theta)p_k(\theta)\,d\theta=0$ for all $k$?


*

*Continuity tells us we can choose $\delta>0$ so that $|f(\theta) - f(0)|< \frac{f(0)}{2}$ if $|\theta - 0| < \delta$ (which in particular implies $f(\theta) > \frac{f(0)}{2}$). Once the existence of such a $\delta$ is established, we can assume it is as small as we need; in particular, we're free to take it to be less than $\pi/2$, without affecting the inequality $f(\theta) > \frac{f(0)}{2}$. If you want to see this more concretely, then take the first $\delta$ that we obtained through continuity, and set $\delta' = \min(\delta,\frac{\pi}{2})$. Then $0<\delta < \frac{\pi}{2}$, and $|\theta|<\delta'$ implies $|\theta|<\delta$ implies $f(\theta) > \frac{f(0)}{2}$.

*Here we're using the fact that $\cos\theta < 1$ when $\theta$ is away from $0$. To make this quantitative, $\cos\theta$ ranges from a maximum of $\cos\delta$ to a minimum of $-1 = \cos\pi$ on the set $\{\delta \leq |\theta|\leq\pi\}$. Therefore
$$
\epsilon - 1 \leq p(\theta) \leq \epsilon + \cos\delta
$$
when $\delta \leq |\theta| \leq \pi$. On the left, we can throw out an extra $\epsilon/2$:
$$
\frac{\epsilon}{2} - 1 \leq \epsilon - 1 \leq p(\theta).
$$
On the right, we have
$$
\epsilon + \cos\delta = \epsilon + 1 - (1-\cos\delta) = \epsilon + 1 - \lambda.
$$
Note $\lambda > 0$. If we choose $\frac{3\epsilon}{2}< \lambda$, then $-\lambda < -\frac{3\epsilon}{2}$, and
$$
\epsilon + 1 - \lambda < 1 - \frac{\epsilon}{2}.
$$
Therefore if we choose $\epsilon < \frac{2}{3}(1-\cos\delta)$, and obtain $\delta$ as above, then
$$
\frac{\epsilon}{2} - 1 \leq p(\theta) \leq 1 - \frac{\epsilon}{2},
$$
or equivalently
$$
|p(\theta)| \leq 1 - \frac{\epsilon}{2}
$$
whenever $\delta \leq |\theta| \leq \pi$.

*This is similar to both 1 and 2. Now we're using the fact that near $\theta = 0$, $p(\theta) \sim \epsilon + 1$. By continuity of $\cos\theta$ at $\theta = 0$, there exists $\eta>0$ such that if $|\theta| < \eta$, then $|1 - \cos\theta| < \frac{\epsilon}{2}$. This inequality implies $\cos\theta > 1 - \frac{\epsilon}{2}$. Therefore
$$
p(\theta) = \epsilon + \cos\theta > 1 + \frac{\epsilon}{2}.
$$
Again, once the existence of such $\eta>0$ is established, then we are free to take it to be as small as we want; in particular we may specify that $\eta<\delta$.


*For example, look at $p_1(\theta) = p(\theta) = \epsilon + \cos\theta$. Then
$$
\int_{-\pi}^\pi f(\theta)p_1(\theta) d\theta = \epsilon\int_{-\pi}^\pi f(\theta) d\theta + \int_{-\pi}^\pi f(\theta)\cos(\theta) d\theta .
$$
Note that the first integral on the RHS is just $\epsilon\hat{f}(0)$, so this is $0$. The second integral is just the first Fourier cosine coefficient: in fact,
$$
\int_{-\pi}^\pi f(\theta)\cos\theta d\theta = \int_{-\pi}^\pi \text{Re}(f(\theta)e^{i\theta} )d\theta = \text{Re}\left(\int_{-\pi}^\pi f(\theta)e^{i\theta} d\theta\right) = \text{Re}\hat{f}(1) = 0.
$$
(I may be off by a constant prefactor of $\frac{1}{2\pi}$, but this is unimportant.) Here I'm using the assumption that $f$ is real-valued to take $f(\theta)$ under the real part. For higher powers of $p(\theta)$, you'll see the other Fourier coefficients come up just like this, because $p(\theta)^k$ is a trigonometric polynomial (i.e. linear combinations of $\sin(k\theta)$ and $\cos(k\theta)$ for all $k$. So all of these integrals vanish.


