When two bodies collide, they apply equal and opposite forces on each other for a brief time. I have looked up the topic in the web, but only found that the bodies apply forces on each other for some short interval of time and not how they move during that interval. After the collision, the two bodies may go in the opposite directions, or in the same direction, but in which direction are they moving during this collision, that is during this brief period of contact (whatever it is microscopically)? I don't know how to go about thinking this problem.
Let's read what says Wikipedia:
A perfectly elastic collision is defined as one in which there is no loss of kinetic energy in the collision. In reality, any macroscopic collision between objects will convert some kinetic energy to internal energy and other forms of energy, so no large-scale impacts are perfectly elastic. However, some problems are sufficiently close to perfectly elastic that they can be approximated as such. In this case, the coefficient of restitution equals one.
So what happens in the real case? Hard bodies are one which are not easy deformable. They get deformed in such a way that to some extend of energy the applied energy is kicked back in a short time.
There is nearly no dissipation of the energy out from the direction of the collision. In the direction of the collision the molecules get shifted but this shift has a minimal - in reference to an elastic body - extend and once has gone through the body returns very fast back and kick the other body.
In which direction are the two bodies moving during a collision?
At the first half of the collision the involved area is simply moving slower (gets deformed) as the whole moving body and at the second half this deformation vanishes completely again. If one of the bodies is in rest the description is a little bit different: In the first half of the collision the involved area starts moving and in the second half the body gains velocity faster the deformed area and the deformation vanishes.
To be more precise, the first and the second "half" are a little of different time.
Each of the bodies experiences a deformation during the collision, and the deformation is not spatially uniform. During the initial part of the collision, the leading edges of the bodies become compressed, while the remainder of the bodies are still traveling at their original velocities, and are not yet compressed. As time progresses, the compression zones grow (at the speed of sound in the material) until the compression zone encompasses the entire body, and its velocity is greatly diminished (or it has stopped all-together). Then the compression starts getting released at the trailing edge of the body, and the size of this released zone grows (again, at the speed of sound in the material) until the entire body is no longer compressed. At this point, the body will have its final rebound velocity, and the bodies separate.