It also influences to some extent which government type a given civ will choose. If you get an AI civ that has Monarchy as a favored government like Persia or Japan, you'll notice that if you get them sucked into war in the Industrial Age, these countries will usually not drop into Communism when war weariness gets too heavy, they go into Monarchy instead. However this isn't absolute, since an Egyptian AI (favored: Despotism, shunned: Democracy) will never go back to despotism in a war, and will likely spend a good bit of time in Democracy once it is available.
Note that the favored and shunned governments of the civ you are playing as have NO bearing on the game whatsoever, and the diplomacy effect of being in another civ's favored or shunned governments is so minor it shouldn't enter into your decision for which government to choose.
You can tell which government a computer opponent is in, of all places, the military advisor screen (F3). On the right hand there's a drop down list with all the other civs in it. When you select one it will say "The Army of <Civ Name> (<Government Type>)". You can also investigate a city and it will tell you at the top of the city screen.