What would the world government do?
I see two key functions: 1) prevent war and 2) shame governments and other institutions into behaving.
If the people in power were behaving, there's nothing particularly inadequate about the existing institutions. (Some of the international financial institutions and trade agreements need... reform, but most of what we have is decent if the people in power behaved themselves.)
How is this government going to prevent war?
It's going to primarily be a court system.
The War Court (working title) is going to be above the UN Security Council and national governments. For a government (or other human organization, including non-state actors and corporations) to use lethal force beyond its territorial jurisdiction, it must go to the War Court and prove that it has exercised all remedies short of using deadly force. The provocation cannot be addressed by an remedy short of deadly force and that the provocation rises to the level of requiring deadly force. The party pleading for the prerogative of going to war must also write the war resolution as narrowly as possible. Also, the war resolution has to be approved through the UN Security Council.
Imposing these reasonable requirements would make it pretty hard to go to war.
What are the consequences of violating the War Court's rulings and going to war anyways?
The people who violate the law will be criminals and subject to prosecution: from heads of state down to soldiers and including diplomats, legislators and judges who went along. For the rest of their lives, they will be criminals or fugitives. When history is written, they will be labeled what they are: murderers and war criminals.
I'll write more about shaming later.