Strictly speaking, you need for classes to be defined so they are disjoint. For example: $(0.5, 2.5], (2.5, 4.5], (4.5, 6.5]$ or $[0.5, 2.5), [2.5, 4.5), [4.5, 6.5).$
In my experience, US textbooks and software tend to use the latter method (closed on the left), and European ones tend to use the former (closed on the right).
If there is no obvious statement which convention to use, pick one and say in a footnote whether 2.5 goes into the lower or upper of the two possible intervals.
In your case, it looks as if integer data is expected, so that the problem doesn't arise. This illustrates a useful approach: pick interval boundaries
that cannot ever arise in the data. For example, if the survey question is "How many people in your household?" then the answer is an integer.