[proofplan]
We first prove the uniform bound $|C(a)|\le N$ by estimating each summand by its modulus. For the sharper bound, we separate the case $a\equiv 0\pmod q$ and otherwise evaluate the interval sum as a finite geometric progression. The denominator is then controlled below by the elementary inequality $|1-e(t)|\ge 4\|t\|_{\mathbb R/\mathbb Z}$, giving the stated reciprocal distance bound.
[/proofplan]
[step:Bound the sum by the length of the interval]
For every $n\in I$ one has
\begin{align*}
\left|e\left(\frac{an}{q}\right)\right|=1.
\end{align*}
The triangle inequality for the finite sum defining $C(a)$ gives
\begin{align*}
|C(a)|\le \sum_{n\in I}\left|e\left(\frac{an}{q}\right)\right|.
\end{align*}
Since $I$ has exactly $N$ elements, this becomes
\begin{align*}
|C(a)|\le N.
\end{align*}
[/step]
[step:Evaluate the nontrivial character sum as a geometric progression]
Assume first that $a\equiv 0\pmod q$. Then $\|a/q\|_{\mathbb R/\mathbb Z}=0$, so the second term in the theorem statement is interpreted as $+\infty$, and the bound from the previous step already gives the desired estimate.
Now assume that $a\not\equiv 0\pmod q$. Define
\begin{align*}
z:=e\left(\frac{a}{q}\right)\in\mathbb C.
\end{align*}
Then $z\ne 1$, because $z=1$ would imply $a/q\in\mathbb Z$, equivalently $q\mid a$. Since $I=\{M,M+1,\dots,M+N-1\}$, we have
\begin{align*}
C(a)=\sum_{j=0}^{N-1}e\left(\frac{a(M+j)}{q}\right).
\end{align*}
Using multiplicativity of the exponential,
\begin{align*}
C(a)=e\left(\frac{aM}{q}\right)\sum_{j=0}^{N-1}z^j.
\end{align*}
The finite geometric progression identity gives
\begin{align*}
\sum_{j=0}^{N-1}z^j=\frac{1-z^N}{1-z}.
\end{align*}
Therefore
\begin{align*}
|C(a)|=\left|\frac{1-z^N}{1-z}\right|.
\end{align*}
Since $|z^N|=1$, the triangle inequality gives
\begin{align*}
|1-z^N|\le 2.
\end{align*}
Thus
\begin{align*}
|C(a)|\le \frac{2}{|1-e(a/q)|}.
\end{align*}
[guided]
We isolate the only case in which the geometric denominator could vanish. If $a\equiv 0\pmod q$, then $a/q$ is an integer, so $\|a/q\|_{\mathbb R/\mathbb Z}=0$. The theorem explicitly interprets the reciprocal term as $+\infty$ in this case. Hence the already proved estimate $|C(a)|\le N$ implies the asserted minimum bound.
Assume now that $a\not\equiv 0\pmod q$. The purpose of this assumption is to make the ratio of the geometric progression different from $1$. Define the complex number
\begin{align*}
z:=e\left(\frac{a}{q}\right).
\end{align*}
If $z=1$, then $\exp(2\pi i a/q)=1$, so $a/q\in\mathbb Z$, which is equivalent to $q\mid a$. This contradicts $a\not\equiv 0\pmod q$, and therefore $z\ne 1$.
We now rewrite the interval using the parameter $j\in\{0,1,\dots,N-1\}$. Since $I=\{M,M+1,\dots,M+N-1\}$, every $n\in I$ has the unique form $n=M+j$ with $0\le j\le N-1$. Therefore
\begin{align*}
C(a)=\sum_{j=0}^{N-1}e\left(\frac{a(M+j)}{q}\right).
\end{align*}
Using $e(x+y)=e(x)e(y)$ for [real numbers](/page/Real%20Numbers) $x,y$, this becomes
\begin{align*}
C(a)=e\left(\frac{aM}{q}\right)\sum_{j=0}^{N-1}z^j.
\end{align*}
Because $z\ne 1$, the finite geometric progression formula applies:
\begin{align*}
\sum_{j=0}^{N-1}z^j=\frac{1-z^N}{1-z}.
\end{align*}
The prefactor $e(aM/q)$ has modulus $1$, so taking absolute values gives
\begin{align*}
|C(a)|=\left|\frac{1-z^N}{1-z}\right|.
\end{align*}
Also $|z|=1$, hence $|z^N|=1$. Applying the triangle inequality to $1-z^N$ gives
\begin{align*}
|1-z^N|\le |1|+|z^N|=2.
\end{align*}
Consequently
\begin{align*}
|C(a)|\le \frac{2}{|1-e(a/q)|}.
\end{align*}
[/guided]
[/step]
[step:Control the geometric denominator by distance to the nearest integer]
Let
\begin{align*}
\delta:=\left\|\frac{a}{q}\right\|_{\mathbb R/\mathbb Z}.
\end{align*}
Since $a\not\equiv 0\pmod q$, we have $0<\delta\le 1/2$. Choose $m\in\mathbb Z$ such that
\begin{align*}
\delta=\left|\frac{a}{q}-m\right|.
\end{align*}
Using periodicity of $e$, we obtain
\begin{align*}
|1-e(a/q)|=|1-e(a/q-m)|.
\end{align*}
For $u:=|a/q-m|\in[0,1/2]$, the identity $|1-e(u)|=2|\sin(\pi u)|$ and the concavity lower bound $\sin x\ge 2x/\pi$ for $0\le x\le \pi/2$ give
\begin{align*}
|1-e(a/q)|\ge 4u.
\end{align*}
Since $u=\delta$, this yields
\begin{align*}
|1-e(a/q)|\ge 4\left\|\frac{a}{q}\right\|_{\mathbb R/\mathbb Z}.
\end{align*}
Combining this with the geometric estimate gives
\begin{align*}
|C(a)|\le \frac{1}{2\|a/q\|_{\mathbb R/\mathbb Z}}.
\end{align*}
[/step]
[step:Combine the two estimates]
In the case $a\equiv 0\pmod q$, the reciprocal term is $+\infty$, and the estimate $|C(a)|\le N$ proves
\begin{align*}
|C(a)|\le \min\left\{N,+\infty\right\}.
\end{align*}
In the case $a\not\equiv 0\pmod q$, the first step gives $|C(a)|\le N$, while the previous step gives
\begin{align*}
|C(a)|\le \frac{1}{2\|a/q\|_{\mathbb R/\mathbb Z}}.
\end{align*}
Therefore in all cases
\begin{align*}
|C(a)|\le \min\left\{N,\frac{1}{2\|a/q\|_{\mathbb R/\mathbb Z}}\right\}.
\end{align*}
This is the desired bound.
[/step]