Let w be the time taken in one way by walking and c be the time taken in one way by car.
Now, according to the question,
In first case, w + c = 6 h 45 min
or
2w + 2c = 13 h 30 min ..(i)
In second case, 2c = 4 h 45 min ....(ii)
From Eqs. (i) and (ii), we get
2w + 2c = 13 h 30 min
⇒ 2w + 4h 45 min = 13 h 30 min
⇒ 2w = 13 h 30 min - 4 h 45 min
⇒ 2w = 8 h 45 min
∴ If he walks both ways, then time taken = 8 h 45 min