Cause of weightlessness I'm a first year engineering student who is new to physics, so I apologize if my question is stupid. But in our statics course we are using the book "Engineering mechanics: statics" by R.C. Hibbeler and it contains the following image:


The astronaut is weightless, for all practical purposes, since she is far removed from the gravitational field of the earth.

Now this conflicts with my previous understanding of weightlessness. I always assumed it was because astronauts are orbiting the earth. But if it's because they are far away from the earth, why would spacecraft spend so much energy to accelerate to such large speeds if it's not really necessary to "stay afloat"?
 A: You are correct that the caption is wrong. The cause of weightlessness is that gravitational and inertial forces cancel, exactly according to the equivalence principle. 
A: Whatever written in the book is wrong.
But let us assume it is correct then had it been the case then the moon would have flown away as well as the ISS along with the astronaut.
A: You are absolutely right, and the caption conveys a common error. The textbook is wrong! Congratulations on discovering this error.
Indeed, gravity at typical spacewalk height is not all that different from gravity at the surface. Because we have that
$$g \propto r^{-2}$$
where $r$ is the distance from the center of the planet, we can estimate (using an Earth radius of 6370 km and height above the surface of 400 km) that gravity at the astronaut's height is actually about 94% of what it is at the surface.
The effect of "weightlessness" is actually due to the absence of normal force, not the absence of gravitational force. Normal force is the force in which something you are in physical contact with "pushes back" against you as you push into it - e.g. if you press your hand into a wall and you feel the "hardness" of the wall. When you are sitting in a chair or standing on the ground, the "sensation of weight" is because the chair or the planet's surface is pushing up against you, into your feet or legs, despite that you are "trying" to move down under the influence of the Earth's gravitational force. The competing effects of these two forces cause a compression of your body, and your brain interprets this as the sensation of having weight.
But in the spacewalking case, you have no contact with the ground, either directly or indirectly (e.g. through a chair), and hence this normal force is absent. Your body does not compress into anything, and as a result, you experience "weightlessness".
And you don't need to go "into space" to do it. You just need some way to isolate yourself from contact with the ground to result in no normal force. A freely-falling airplane will suffice, and there are some airplanes that are specifically designed for this purpose and used for astronaut training. (An airplane in powered flight will not, because then you have now the lift force on the plane that is keeping it aloft being translated into a source of normal force).
A: The statement in the image is shockingly wrong. Given that the Earth is visible behind the astronaut, the reduction of the gravitational force due to distance must be fairly small; on the ISS for example the force of gravity is about 88% the value at the Earth's surface - very far from being negligible! The reason why the astronaut appears weightless is that she is in freefall, accelerating downwards at $g$.
A: The astronaut can stay afloat because he/she is in free-fall around the earth. Picture a cannon on a cliff shooting a projectile with increasing speed. Eventually, with enough speed, the projectile will make a whole round trip. In space, with less air-resistance and friction, this process can go on for a much longer (in theory infinite, in reality finite, vacuum isn't really 100% empty) time. The caption is thus wrong.
A: I'm afraid your book is wrong. At distances from the Earth where it's still as big as in this picture, the gravitational field is still very relevant. As you said yourself, the astronaut is in orbit around the Earth, and thus effectively in free fall, leading to the illusion of an absence of gravity.
A: This question is answered really well by the answers above. Of course, as explained in all answers the statement quoted from your textbook is incorrect. 
The phenomenon of weightlessness could be explained in two different ways:


*

*The object orbiting the planet is in free fall (as described in other answers).

*The centrifugal force counteracts the earth's gravitational force of attraction.
As the first point is explained by the other answers, I'd like to throw some light on the second point.
Centrifugal force is a type of inertial force (also called a "fictitious" or "pseudo" force) used in a non-inertial frame in order to apply Newton's laws of motion happily as we used to do in an inertial frame. Or in easier terms, you may consider it as some force which pushes you in the opposite direction when you make a sharp turn in your car.
Let us consider the following image:

In an orbiting satellite's reference frame the centrifugal force counteracts the centripetal force giving a resultant force of zero. Since there is no net force on the object everything in the object's reference frame remains at rest or in uniform motion. What happens when the object stops orbiting? Then it'll simply fall back to earth as there'll be no centrifugal force.
In order to understand why the quoted text is incorrect let's consider another example. Imagine a very tall (very very tall) tower from the equator. Inside the tower, at an altitude of $400 \mathrm{km}$ from the mean sea level (which is the average altitude of the International Space Station), will you feel weightlessness? 

  No. You'll be able to stand on the floor but the net force on you is not entirely due to gravity but also due to centrifugal force. This time the centrifugal force is due to earth's rotation about its axis.

