In the Star Trek series, the governmental body that Starfleet had to answer to was the United Federation of Planets. One presumes it was the Federation that created Starfleet.
Since the Federation is made up of many different planets with utterly different customs, and different ideas about right and wrong, it would not be at all surprising if there was a lot of interplanetary strife. And I don't really see Starfleet being sent to attack a planet that decided to drop out of the Federation.
But what if the Federation fell apart? What if issues arose to the point that nearly every planet in the Federation decided to drop out and go it alone?
Now, the most likely fate of Starfleet if the Federation fell apart is that the individual planets would demand pieces of Starfleet--- ships, starbases and the like.
But with the central authority having fallen apart, Starfleet might not be much inclined to meet those demands, especially as each world would have different ideas as to how much of Starfleet they were entitled to. Starfleet might choose to hang together just long enough for these things to be worked out in some authoritative way, and in time realize there is no authoritative body able to make that happen.
With the fall of the Federation, the biggest challenge faced by Starfleet would be how to deal with the loss of tax revenues. But if you are enough of a Star Trek geek, you may have noticed a certain lack of commercial space transport. There are not many private space liners or space freighters out there, perhaps because of the dangers of encountering hostile forces in an unarmed ship.
Starfleet, therefore, could continue by offering space transportation for a fee, and also providing defense of any private space transport for a fee. Planets who found themselves without adequate space transport after the Federation ended would be eager to avail themselves of the service.
There is also the possibility of selling defensive services. This would make Starfleet into a fleet of mercenaries. It could even degenerate into a protection racket if Starfleet people weren't such Big Damn Heroes. Various worlds might pay Starfleet ships to patrol near their star systems, catching any hostile vessels that might be coming their way.
The big culture shock for Starfleet people, the pampered children of the Federation taxpayer, would come as they had to start looking at the bottom line for the first time ever. Exploring strange new worlds would have to take a back seat to transporting passengers and cargo and doing routine patrols. I believe that in time they would have to wise up and add a Merchant Officer to their command crew, just as they have a Science Officer.
I think in time Starfleet would adapt, would perhaps even see the new order of things as beneficial to them. What do you think?
In a writing project of my own, Starship Destine, I've created a world in which something like the fall of the Federation has occurred in the past, and the Fleet has learned long ago to cope with that situation.
Please consider 'liking' us on Facebook.