At the end of Inheritance Cycle, Eragon leaves in a ship from Alagaesia supposedly never to return. But why is that he needed a ship, he had Saphira and the powerful magic of the ancient dragons at his disposal. Why couldn't he have just flown away?
As I recall Eragon was leaving to find and set up a new home for the Dragon riders, and somewhere safe to keep the Eldunarí. Setting up such a place would require large amounts of supplies and other people (everything from new prospective riders, to people to build this new "home"). A ship is a much more logical choice for carrying the large amounts of supplies and resources rather than Eragon and Saphira having to fly everything all back and forth!
Also the Ship can be sent back for more supplies once a base has been established, and Eragon can continue in his work.
As mentioned in other answers Saphira also needs to land to rest, and as the don't know how wide the Eastern Sea is they don't know how long she would have to fly to reach her destination.
Because they were taking a lot with them, and it would have been unfeasible for Saphira to carry it all in flight.
This has already been mentioned in the other answers, but I thought it was worth adding a canon quote from the book itself (emphasis mine):
The vessel looked as Eragon knew it would, for he recognized it from his dreams, and a sense of inexorable fate settled upon him as he gazed at it.
This was always meant to be, he thought.
They spent the night in Silthrim, which was much like Ellesmera, although smaller and more densely built. While they rested, the elves loaded the Eldunari onto the ship, along with food, tools, cloth, and other useful supplies. The ship's crew was composed of twenty elves who wished to help with the raising of the dragons and the training of future Riders, as well as Blodhgarm and all of his remaining spellcasters, save Laufin and Uthinare, who at that point took thir leave.
-- Inheritance, p.842
That's way too much for poor Saphira to carry all on her own, even in several trips. And there's no way of knowing how long the trips would have to be in any case.
Because he wasn't traveling alone
Why did Eragon leave in a ship? Why not fly?
Because Eragon wasn't traveling by himself. A fair number of elves were going with him and Saphira, to help raise the next generation of dragons.
Remember that Eragon and Saphira were not traveling alone; if they had tried to fly the whole way it might have been harder for the elves to travel with them, and also carry other supplies, like food. (as previously mentioned, the supplies problem could be fixed with magic)
Also, a boat can provide shelter, which is nice to have.
It's easier to ride a boat than walk/run even if elves are really good at that sort of thing.
They could take the boat apart and use it for building materials when they arrive at wherever they're going.
Saphira needs to rest periodically. As mentioned earlier in the book, her max flight time is about 8 hours. Going across the sea makes it difficult to know for sure that the goal is obtainable. Plus the supplies required no doubt take up space, which would make things even more difficult.
It doesn't really indicate on any map, but I always imagined an Eastern Sea that they were headed towards.