We are considering the one-dimensional scalar conservation law,
$$
\frac{\partial u}{\partial t} + \frac{\partial f(u)}{\partial x}= 0, \quad x \in \Omega, \quad t > 0,
$$
subject to appropriate initial and boundary conditions. For a DG method, we would like to seek solutions $u_h(\cdot, t)$ in the space $V_h \subset L^2(\Omega)$ containing functions that are degree $p$ polynomials on each element $D^k$ such that the residual is orthogonal to all test functions $v$ in that space (due to linearity of all terms with respect to the test function, it is sufficient to consider only basis functions $\{\psi_n\}_{n=1}^{N}$, where in one dimension, $N = p+1$, as you have done). This might imply that for each element $D^k$, the local solution $u_h^k$ statisfies
$$
\int_{D^k}v\left(\frac{\partial u_h^k}{\partial t}+ \frac{\partial f(u_h^k)}{\partial x}\right)\, \mathrm{d} x = 0, \quad \forall v\in V_h.
$$
The above local formulation, however, does not enforce any boundary conditions or connection between elements, so we cannot hope to obtain a well-posed approximation this way. In contrast with the continuous Galerkin approach of restricting $V_h$ to satisfy essential boundary conditions and inter-element continuity, a DG method involves the weak enforcement of interface and boundary conditions through a numerical flux function.
To apply the numerical flux, the second term in the above integral can be expressed through integration by parts as
$$
\int_{D^k}v\frac{\partial f(u_h^k)}{\partial x}\, \mathrm{d} x = \left[v f(u_h^k) \right]_{x_{k-1/2}}^{x_{k+1/2}} - \int_{D^k} \frac{\partial v}{\partial x} f(u_h^k) \, \mathrm{d} x,
$$
where $x_{k-1/2}$ and $x_{k+1/2}$ denote the left and right boundaries of $D^k$. Of course, we could apply integration by parts in higher dimensions for a vector-valued flux $\mathbf{f}$ as
$$
\int_{D^k}v \nabla \cdot \mathbf{f}(u_h^k)\, \mathrm{d} x = \int_{\partial D^k}v \mathbf{f}(u_h^k) \cdot \mathbf{\hat{n}} \, \mathrm{d}s - \int_{D^k}\mathbf{f}(u_h^k) \cdot \nabla v \, \mathrm{d} x,
$$
which motivates the more general notation presented by Hesthaven and Warburton. Applying the integration by parts formula results in a "weak" formulation of the DG method,
$$
\int_{D^k}\left( v\frac{\partial u_h^k}{\partial t} - \frac{\partial v}{\partial x}f(u_h^k)\right)\, \mathrm{d} x = - \left[v f^* \right]_{x_{k-1/2}}^{x_{k+1/2}},\quad \forall v\in V_h,
$$
where $f(u_h^k)$ has been replaced with the appropriate numerical flux $f^*$ for the boundary/interface term. Now using integration by parts in "reverse", we can go back to a "strong" formulation,
$$
\int_{D^k}v\left(\frac{\partial u_h^k}{\partial t} + \frac{\partial f(u_h^k)}{\partial x}\right)\, \mathrm{d} x = \left[v \left(f(u_h^k) - f^*\right) \right]_{x_{k-1/2}}^{x_{k+1/2}},\quad \forall v\in V_h,
$$
where the left-hand side is the inner product of the test function and residual, and the right-hand side is a penalty term which weakly enforces inter-element coupling or boundary conditions.
Please let me know if this was helpful or if you have any further questions.