Distance and displacement are quite different from one another. Distance is the sum of the lengths of all the legs of a trip. Here, that would be 2.5 km + 2.5 km = 5.0 km.
Displacement, on the other hand, is the distance, with direction, of the change in position (if any) between original location and final location.
Here, that's 2.5 km east plus 2.5 km west. Due to the "east" and "west," you must subtract 2.5 km from the original west-to-east distance. The resultant is zero. The displacement is zero.
Draw a number line. Plot x=0. Now draw an arrow from x=0 2.5 km to the right (east). Now turn around and move 2.5 km to the left (west). You'll end up at your starting point. So: your displacement is zero.