Let the length of the mountain road be s.
The uphill time is S/3.
The downhill time is S/6.
Then the average speed v = 2s/(s/3+s/6) = 4km.
Method 2:
Let's say that the distance from his going up and down the mountain is 12km.
Then it took him four hours to go up the mountain and two hours to go down the mountain. The average speed equals the distance divided by the time. The total distance is 24 kilometers (uphill distance+downhill distance), and the total time is 6 hours (uphill time+downhill time). The average speed of 24 divided by 6 is 4 kilometers per hour.
12+12 = 24km.
4+2=6 (hours)
24/6=4 (km/h)
Method 3:
2/( 1/3+ 1/6)=4 (km/h)