Millions of years ago on Cybertron, before the war, Skyfire and Starscream were good friends and fellow scientists. On a mission of exploration to prehistoric Earth, Skyfire was lost in a storm. Starscream searched, but there was no sign of his comrade. He returned home.
Millions of years later, after the Autobots and Decepticons had crashed and awoken on Earth, the Decepticons found Skyfire, encased in a block of Arctic ice, and revived him. Skyfire joined them due to his past friendship with Starscream, though he expressed discomfort with their methods. When Skyfire's compassion for humans led to his disobeying orders, Starscream, who had changed much in the intervening millennia, turned on his friend. Skyfire left the Decepticons and joined the Autobots, sacrificing himself to be buried beneath the ice again to stop the Decepticons' plans. The Autobots held a memorial service in his memory at the location of his involuntary burial.
The Autobots returned later to dig him up when they needed a ride down to South America. Megatron and his Decepticons were in Peru seeking the Crystal of Power, which was kept in an Incan temple. After battling the Decepticons, Skyfire arrived at the temple to find Thundercracker guarding it and the crystal inside. Thundercracker was angry at Starscream, and was willing to let Skyfire past him to destroy the crystal so long as Starscream got in trouble. Starscream overheard this and shot Skyfire in the back, knocking him out.
At one point, Optimus Prime actually pats Skyfire on his jet mode's nosecone, like a dog. Sucks to be Skyfire.
As the old adage goes, do something right once, and it's your job. From then on, Skyfire's only apparent duty was to shuttle the Autobots around Earth and even to Cybertron (when it was in Earth orbit).
Skyfire (or a very similar space vehicle) can be briefly seen as part of the Autobot fleet attacking the Quintessons. He was shot along with Powerglide and several Aerialbots. The Aerialbots survived so Skyfire might have survived as well.