This is the latest SpaceX test of the stage return vehicle, nicknamed the "Grasshopper". In real use, it won't go just up and down, and will instead be used to fly the first stage back to the landing pad to land safely, after it has separated from the upper stages of the rocket. This is to decrease recovery and reusability costs. Imagine launching a rocket, and instead of it falling into the ocean and needing tons of repairs and time to turn it around, that it literally flew back to the launch site, and landed on the pad like we see in the video. Would only need an inspection and fuel, and it could be ready to fly again.