Light does not travel forever in the sense that it eventually fades or dissipates over vast distances. While light can travel great distances through space, it encounters various factors that cause its intensity to diminish.
One factor is the phenomenon known as "cosmological redshift." As the universe expands, the wavelengths of light traveling through space also stretch, causing the light to become "redshifted." This means that the light shifts towards longer wavelengths, moving towards the red end of the electromagnetic spectrum. As the wavelengths of light increase, its energy decreases, and eventually, the light becomes so stretched and diluted that it is no longer detectable by our current instruments.
Additionally, interstellar dust and gas can scatter and absorb light, reducing its intensity over long distances. These particles can absorb and re-emit photons or scatter them in different directions, effectively attenuating the light's original brightness.
Furthermore, the inverse square law of light propagation states that the intensity of light diminishes with the square of the distance from its source. As light spreads out over vast distances, its intensity decreases rapidly.
Considering these factors, light does not travel indefinitely without any loss of intensity. It eventually becomes too faint to detect, and its energy gets spread out over vast cosmic distances.