that is easy, man, just draw a pic.
you want the following to be satisfied: |x-y|<0.5
x-y < 0.5 and x-y > -0.5
which is equivalent to
y > x-0.5 and y < x + 0.5
now draw a unit square [0,1]x[0,1], abscissa represents variable X, and ordinate corresponds to variable Y. draw these two lines above, I mean, plot the inequalities. you'll get the region between two parallel lines, and its area is just what you need - that is the probability of |x-y|<0.5. it's easy to figure out the area, I leave it up to you