Thinking of integral as sum of continuous numbers is unsound at best, and your question is a good example of why. Instead, a better comparison can be made with sum of areas of rectangles of a certain width (say, w) whose heights match the function (i.e. x). The smaller the width of the bars, the closer to the integral you get. They both become equal as the width of the bars becomes infinitesimally small.
Let me try to illustrate this with a few of pictures. Firstly, here's a picture representing your example. The sum of integers is represented by yellow bars of width 1, while the integral is represented by the green area.
You can see that the sum of bars has an extra rectangular space, of height 2 and width 0.5, at the very right. That's why your sum is 1 more than the integral.
A better approximation can be made if we reduced the width of the bars. For example, in the following picture, w = 0.25:
Clearly, the area of the bars is now closer to the actual integral than the previous example. The same trend continues as you keep making the bars narrower, ultimately converging exactly to the integral as w tends to 0.