I am reading the book "Discrete Mathematics and Its Applications". It showed me the definition of linear recurrence relation.

Why can "the right-hand side is a sum of previous terms of the sequence each multiplied by a function of $n$" conclude "it is linear"? And what is the function of $n$?
Linear in the context of recurrence relations just means that the nth term can be written as a linear/first degree polynomial in some of the previous terms.
I think your source missed out the word linear before "function of n".Think of each term, like $a_{n-1}$, as x. So since its linear, like $ax+b$, we're going to have constant coefficients, $c_i$, for the $a_{n-i}$.
I was thinking you might have another constant at the end (not a coefficient) but then it can still be written in the form from your textbook; see Marcus Andrew's answer to this question.