The main formula used in work-rate, distance-speed problems is:
Work=Rate*Time, or Distance=Speed*Time.
Thus, the time is:

.
In our problem, the total distance is 3 km + 3 km = 6 km.
the total time is 20 min + 25 min = 45 min.
60 minutes are 1 hour, then
45 minutes are

Thus, the average speed is : distance/time = 6 km/ 0.75 h = 8 km/h
Answer: 8 km/h