jbs said:
When my armies conquer a city, sometimes they are given the choice of installing a new gov or razing, and sometimes they just automatically destroy the city. Does anyone know what determines this? How do I control it?
That can only happen to size-1-towns, so you would only have to consider these.
If that town has an actual border expansion, it won't be autorazed.
Despite of any expansion, if the town has a citizen of your nationality (e.g. re-capture), it won't be autorazed.
Then there's some fuzzy scenarios I'm no way sure about.

Sometimes a town won't be autorazed, although it has no actual expansion and no citizens of your nationality.
some guessings:
-town has a citizen of another nationality than the current owner's (and that civ must be still alive?) [somehow I prefer this hypothesis]
-the town had an expansion under another civ's rule (that civ must be still alive?)
about rep testing:
pretty much what SJ Frank said, except that you probably don't really want to make a deal, but just test your rep.
Put a deal on the table that is simply not acceptable (watch your advisor) for the AI and press the "accept"-button (e.g. offer 1gpt for their 21g or similar).
If they don't accept because it's highway robbery (which we know it indeed is...), their leader will say so (or something similar in that fashion).
If they don't accept because your rep is trashed, their leader will also tell you ("we know what you did before..."). That is, if the leader is aware of your rep hit.
edit:
on-topic: I usually raze.