Distance refers to how much ground is covered over the course of a motion. It is a scalar quantity; that is, a direction-ignorant quantity. If an object moves one direction and later changes its direction to move another direction, then that direction change has no impact upon the distance traveled.
In this question, the object first moves in the positive direction away from the starting position. At a certain time the person is a maximum distance from the starting position and then turns around and walks back towards the starting position. To determine the distance traveled from a position-time graph, you must be able to read coordinates off the graph. Using the coordinates, you must determine the distance from the starting position to the maximum distance away. Then use coordinates to determine the distance from the maximum distance away to the final position. Add these two values to determine the total distance.