Represent the route as an interval, say [0,100] representing the percentage of the way along. Assume that the two days walks are continuous functions from [5,17] -> [0,100], say f and g. We have f(5)=0, f(17)=100 and coming back g(5)=100, g(17)=0. You're being asked to show that there exists a t in [5,17] such that f(t) = g(t). Apply the IVT to the function h(t) = g(t) - f(t) which has the property that h(5) = 100, h(17)=-100.