Star Trek: The Next Generation - All Good Things...

Capt. Picard finds himself shifting continually into the past, future and present and must use that to discover a threat to humanity's existence.