This is not as simple as it looks.
His average speed is NOT (10km/hr + 50km/hr)/2 = 30 km/hr.
You have to use the definition of speed:
Speed = (total distance covered) / (time to cover the distance).
Let's say the distance up (and down) the hill is 'd' .
Then the time it takes to go up the hill is (d/10) hours.
And the time it takes to come down the hill is (d/50) hours.
Total distance = 2d km
Total time = (d/10) + (d/50) = (5d/50) + (d/50) = 6d/50
Speed = distance/time = 2d/(6d/50) = 100d/6d
Speed = 100/6 = 16-2/3 km/hr