I actually found the answer. Here is my explanation:
As it may seem very complex or impossible, it is not and in fact, just add in variables. u for the distance of going uphill, f for the distance of flat ground, d for the distance of going downhill, and (u+f+d) for the total distance walked.
To find the average speed, the equation we need to set up must be the total distance over the total time. We first make the equation for the first trip's time. We would divide u by 100(the speed of going uphill), f by 120(the speed of going across flat ground), and d by 150(the time going downhill). It would look like this:
u100+f120+d150
Next, we would set up the equation for the second trip going in reverse. We would divide u by 150 this time instead of 120 because we are walking the other way and the same for d. We would keep f the same since its neutral no matter which way you are walking across it. Here is what it would look like:
u150+f120+d100
Now to get the total time, we must add them together.
u100+f120+d150+u150+f120+d100
We find a common denominator, which is 600, and then add them all together.
6u600+5f600+4d600+4u600+5f600+6d600
6u+4u+5f+5f+4d+6d600
10u+10f+10d600
Now we can factor and simplify. As we can see below, we can factor out 10 and simplify.
10(u+f+d)600
u+f+d60
Now, we know that (u+f+d) is the distance for one trip so the total distance would be 2(u+f+d) and u+f+d60 is the total time. Now we divide the total distance and the total time that we have gotten.
2(u+f+d)u+f+d60
We multiply by 60 top and bottom to get 120(u+f+d)u+f+d. Lastly, we simplify by dividing top and bottom by (u+f+d) to get the final answer of 120.