You need to be more specific about what you don't understand by saying what you do understand or what conclusions you are drawing from the given information.
"Two sides of the square (of side 1) are on the positive axes". From that, you should conclude that coordinates of the square's corner on the xaxis are (x,0) and (x+1,0) for some value of x. Since it is a square (of side 1), the other two coordinates must be at (x,1) and (x+1,1) [or conceivably (x, 1) and (x+1, 1)]
Similarly, you should conclude that coordinates of the square on the yaxis are (0, y) and (0,y+1) for some value of y). Since it is a square (of side 1), the other two coordinates must be at (1,y) and (1,y+1) [or conceivably (1, y) and (1, y+1)]
But there are only 4 corners, so both descriptions must match the same 4 corners. Can you come up with any combination that works besides (0,0), (0,1), (1,0), (1,1)?
[You should reach that conclusion much easier from the density function, which is clearly nonzero only on that particular square, plus the location of the city hall, which presumably is going to be within the square. You might have expected that the city hall would be at the center, but the density function makes that unreasonable.]
If he can travel only on segments parallel to the axes, the it should be obvious that the shortest travel distance from (x,y) to (0,0) is x+y. [It would be pretty farfetched to argue that an actual resident might not take the shortest route; for example going from (x,y) to (x,1), then to (0,1), then to (0,0).] There are many variations of the shortest route, for example (x,y) to (.5x,y) to (.5x,.3y) to (0,.3y), to (0,0), but all those variations have length x=y.
