According to our current understanding of physics, it is not possible for an object with mass, such as a spacecraft, to travel at or exceed the speed of light in a vacuum. As an object with mass accelerates towards the speed of light, its energy requirements increase to an infinite amount, making it impossible to achieve or sustain that speed.
However, let's consider a hypothetical scenario where an object could travel at the speed of light. In this case, if the object were to move back and forth in a constant distance, several consequences would arise based on the principles of special relativity:
Time Dilation: As an object approaches the speed of light, time dilation occurs. This means that time for the moving object would appear to pass more slowly relative to an observer at rest. If the object were traveling at the speed of light, time would effectively stand still for it. Therefore, from the perspective of the object traveling at the speed of light, the back-and-forth motion would seem to happen instantaneously.
Length Contraction: Length contraction is the phenomenon where objects moving at high speeds appear shorter in the direction of their motion. As the object approaches the speed of light, the distance between the two endpoints of the back-and-forth motion would appear to contract from the perspective of an observer at rest.
Relativistic Effects: As the object moves at relativistic speeds, other relativistic effects would come into play, such as relativistic mass increase and the warping of spacetime. These effects would further complicate the behavior and perception of the object and its motion.
It's important to note that these hypothetical scenarios exist within the realm of special relativity, which describes the behavior of objects moving at speeds below the speed of light. The theory does not provide a framework for objects traveling at or beyond the speed of light.