Just assume the distance is 80 miles.

Then the amount of time for him to got at 10 m/h is 8 hours.

And the amount of time for him to return at 8 m/h is 10 hours.

Average speed is total distance divided by total time.

The total distance was 80+80=160.

The total times was 8+10=18.

The average speed is 160/18=8.8888.. approximately 8.9 hours.

As an excerise show that this is the same number no matter what assumed distance you take in the beginning.