"Oh no, the answer is not 25 kmph. The answer, I think, is 24 kmph.
Let the distance to the shop be "D". Let the time to reach the shop at 20kmph be T1 and time to return home from the shop at 30 kmph be T2.
Speed = distance / time. Therefore, T1=D/20 and T2=D/30. Total distance travelled is D+D=2D. Total time required = T1+T2 = D/20+D/30. Therefore, total time = D/12.
Average speed = total distance / total time.
Therefore, average speed = 2D / (D/12).
So, average speed = 2D x 12 / D.
Thus, average speed = 24 kmph.