My textbook gives the following justification when introducing Fourier series: (NOTE: I have excluded the intermediate calculations that are irrelevant to this specific question).
(1) $ f(x) = \dfrac{a_0}{2} + \sum_{n = 1}^{\infty} \left( a_n\cos(nx) + b_n\sin(nx) \right) \forall x \in [-\pi,\pi]$
(3) $a_0 = \dfrac{1}{\pi} \int^\pi_{-\pi} f(x) dx$
(7) $a_n = \dfrac{1}{\pi} \int^\pi_{-\pi} f(x) \cos(nx) dx$
By (3), formula (7) is also valid for $n = 0$; this is the reason for writing the constant term in (1) as $\dfrac{a_0}{2}$ rather than $a_0$.
The justification for writing the constant term in (1) as $\dfrac{a_0}{2}$ rather than $a_0$ does not provide enough information to make sense (to an introductory reader). I would greatly appreciate it if people could please take the time to elaborate on this justification and clarify it for an introductory reader such as myself.
We have:
$$f(x) = \frac{a_0}{2}+\sum_{n=1}^{\infty} a_n\cos(nx) + b_n\sin(nx),$$
then we can write:
$$ \int_{-\pi}^{\pi}f(x) = \int_{-\pi}^{\pi}\frac{a_0}{2} dx + \sum_{n=1}^{\infty}a_n \int_{-\pi}^{\pi}\cos(nx) dx +\sum_{n=1}^{\infty}b_n \int_{-\pi}^{\pi}\sin(nx) dx $$
where $\int_{-\pi}^{\pi}\cos(nx) = 0$ and $\int_{-\pi}^{\pi}\sin(nx) = 0$. Then, $$ \implies a_0 = \frac{1}{\pi} \int_{-\pi}^{\pi}f(x)dx.$$
Here, we also can find the formula for
$$ \int_{-\pi}^{\pi}f(x)\cos(mx) = \frac{a_0}{2}\int_{-\pi}^{\pi}\cos(mx) dx + \sum_{n=1}^{\infty}a_n \int_{-\pi}^{\pi}\cos(nx)\cos(mx) dx \\+\sum_{n=1}^{\infty}b_n \int_{-\pi}^{\pi}\sin(nx)\cos(mx) dx $$
where $$ \int_{-\pi}^{\pi}\cos(nx)\cos(mx) dx = \begin{cases} \pi & n = m \\ 0 & n \neq m \end{cases}, $$
$$ \int_{-\pi}^{\pi}\cos(mx) dx = \frac{1}{m}\sin{mx}|_{-\pi}^{\pi} = 0,$$ $$ \int_{-\pi}^{\pi}\sin(nx)\cos(mx) dx = 0$$ here, $\sin(nx)\cos(mx)$ is an odd function, then we have:
$$\implies a_n = \frac{1}{\pi} \int_{-\pi}^{\pi}f(x)\cos(nx)dx.$$
If, from the first, you use $a_0$ instead of $\frac{a_0}{2}$, then your formulas would be different from each other by a factor: $\frac{1}{2}$. However, in your textbook and also above, it seems for simplification and uniform formulation of the two $a_0$ and $a_n$, it is provided that way. Now, you need to consider (memorize) one formula for $a_n$; then, for $a_0$, just put $n=0$ to make the formula ready for it for calculation.