1) Let x = time on foot, y = time on bike
x+y=3
7x+22y=42
The question is asking us to find the total time traveled on each method of movement. We are given two unknown variables, time spent on foot and time spent on bike, which have to total to three hours. This is where the first equation came from.
For the second equation we know the speeds he was traveling using each method. Remember x and y actually have the units of hours associated with them, so the equation looks like this before we cancel units:

I forgot to put it in the picture but the unit of miles can then be canceled out by division since it appears on both sides of the equation.