The United Federation of Planets (commonly referred to as The Federation) was an interstellar federal republic, composed of planetary governments that agreed to exist semi-autonomously under a single central government, and to share their knowledge and resources in peaceful cooperation and space exploration. (DS9: "Battle Lines"; VOY: "Innocence")
The Federation's government was a representative republic, headquartered on Earth. (TOS: "Amok Time"; DS9: "Rapture"; VOY: "In the Flesh"; Star Trek IV: The Voyage Home)
The government consisted of three branches: the executive, the legislature and the judiciary.
The Executive:
The executive branch was responsible for the day-to-day management of the Federation. The democratically-elected Federation President was the head of this branch. (DS9: "Paradise Lost"; Star Trek IV: The Voyage Home) The Federation President served as both the head of state and head of government; as chief executive officer of the government, the President determined most of the Federation's foreign policy, managed budgetary concerns, and served as supreme commander of the Federation's military forces. (Star Trek VI: The Undiscovered Country) The President's office was located in the Earth city of Paris on the European continent. (Star Trek VI: The Undiscovered Country)
The Federation Cabinet was a special executive committee to the President of the United Federation of Planets. (DS9: "Extreme Measures")
The Legislature:
The Federation Council was the unicameral legislative body of the Federation. (TOS: "Amok Time") Composed of representatives from the various member worlds, the Federation Council held the power to create, amend, and ratify Federation law. (DS9: "Rapture"; TNG: "Force of Nature") The Federation Council also held a great deal of influence over the operations of the Federation's military service, the Federation Starfleet. It sometimes served as the judging body of specially-convened courts-martial, and on occasion issued operational orders to Starfleet. (Star Trek IV: The Voyage Home; TNG: "The Defector") The Council also held influence over the making of Federation foreign policy. (DS9: "The Way of the Warrior", "For the Cause") The Council's meeting chamber was in the Earth city of San Francisco, on the west coast of the North American continent.
The Judiciary:
The judiciary was the branch of the Federation's government which was responsible for the administration of justice in the name of the state according to Federation law. Its highest level was the Federation Supreme Court. (DS9: "Doctor Bashir, I Presume")
The exact nature of the government of the Federation has never been made clear on screen. From the information available, the United Federation of Planets would appear to be a constitutional representative republic, similar to that of the United States, prior to the 1860s.
The exact division of powers between the Federation government and the governments of its member worlds is unknown, though various episodes indicate the Federation placed great value on maintaining local sovereignty over local affairs. Member worlds were left to manage their own governance in accordance with their own traditions and local laws, so long as the general requirements of membership were met.
However, Federation law did grant the government emergency authority to override local governance and declare martial law on a member's territory. (TNG: "Force of Nature"; DS9: "Homefront")
From Memory Alpha
http://memory-alpha.org/en/wiki/United_Federation_of_Planets