Depends on the city and its tiles and resources. Since they're built in different ways, I don't find much conflict between them. I try to max out my districts and have enough farms for rapid growth (20+ turns is too long, build more farms). Since districts don't have to be worked, it really isn't an issue.How many farms should I build versus building districts?
Otherwise, have enough farms to grow. if you don't have the pop to work the farms (or housing from other things to even grow more pop), don't build them outside of the core 3 triangle. Never over farm. Yes you get more housing, but if you lack amenities, then mass farm/growth to fill housing is bad if it means driving you into negative amenities (so get entertainment districts instead).
strangely, with the trade routes being that powerful, you don't actually need that many farms. probably 2-3 farms per city, build in the overlapped tiles between cities.
Well, if you start in negative amenities in a war, you'll find rebels very soon.
I've never seen this happen in any game, what do the rebels do?
Housing problems can be solved by aqueducts, granaries, sewers, districts, policies, (and wonders?). Farms only give 0.5 housing each while taking a whole tile.
Heck, currently my riverside capital doesn't have aqueducts and it can support up to 25 pops, and only at 19 pop now, with I think only 3 farms supplying it.