Let the distance to the bike shop be d miles. Then the time going is
1
3
d

hours and the time returning
1
12
d

hours. The total time travelling is therefore
1
3
d + 1
12
d = 5
12
d

and the total distance is 2d miles giving the average speed as
2d
5d
12
= 24
5

miles per hour.