Hint: Remember that Time = Distance ÷ Speed, and Speed = Distance ÷ Time.
Answer: 48 miles per hour.
Time = Distance ÷ Speed
Speed = Distance ÷ Time
The outward journey took 174 miles ÷ 40 mph = 4.35 hours.
The return journey took 174 miles ÷ 60 mph = 2.9 hours.
So I travelled a total of 2 x 174 = 348 miles. I did this in a total of 4.35 + 2.9 = 7.25 hours.
My overall average speed was therefore 348 miles ÷ 7.25 hours = 48 miles per hour. QED.