A discrete function is a relation where the domain and the range take a specific discrete set of values and not the whole set of the real numbers.
In this case, it's okay to model the scenario with a line because all of the points will fall on the line. Only points corresponding to the integer domain values, however, actually represent the scenario.
Basically, a linear function that represents this situation serves as a prediction model to generalize this type of situation, but for this case, just the value inside the domain makes sense to this particular case.