I will tell you what the problem is And If anybody has a good argument that this is a good mechanic let it hear because I believe its not!!!!!!!!!
The AI makes his war decission on military strenght thats why you see so uselesss wars between AI's and you. (Or if you just destroyed a AI someones army everyone dows the person)
Unlike in civ 4 where the AI declares war on someone who He hates(and is close) because of certain flavors for example : aztecs,vikings,mongols have a low peace rate so they mostly hate people with high peace rate.Or if someone is on a other religon this olso can create fire works..
(Note : I know this is not 100% true sometimes they choose to dow you like in lets play of elizabeth of TheMelnTeam but it isn't allways like that mostly warmongers )
However non of this is presented in civ 5 the AI just makes his decission on military strenght.
Thats why catherine declares war on me the early game and in the late game she wants to sign a decleration of friendship doesn't make sence at all.
All of the above does happen, however it tends to happen mainly if you aren't actively engaging in diplomacy. I've had DoWs from AIs that can't beat me based on military strength if they have a particular objective or need to stop you getting too far ahead. I've also maintained peace with militarily far superior civs (Mongolia for most of my last game, for instance).
There are certainly serious problems with the diplomacy AI, however it works better if you don't treat it like the Civ IV AI where you do something (such as adopt the same religion) and you get a set of +s and -s that will remain the same forever more; relations change in Civ V because of the actions of both you and other civs, and usually these changes are negative. You don't have control over who will denounce you, but a denouncement will have a negative effect on anyone who doesn't dislike the denouncer (even your friends). Most actions that relate to victory conditions - including settling new cities, competing for city-state favour (especially if you displace their existing ally), completing wonders another civ wants and aiming for the same victory type - will negatively affect relations with someone. "We've been to war in the past" can be a neutral effect or a negative modifier based on whether the AI dislikes you for other reasons.
All of this is fine, the trouble is that while a lot of these are unavoidable (and how do you know which wonders the other civ wants?), there are very few ways of mitigating these affects or gaining positive modifiers that can compensate. It's this imbalance which makes civs hostile disproportionately often.
In my case with Mongolia, I maintained peace until it became clear to the AI late in the game that they had no other way of stopping me from winning than to attack my city-state allies. Mongolia was not after a diplomatic victory (or to deny me one) for most of the game and so was not interested in CSes. We apparently had no wonders in common. They were the other side of various city states from me. I denounced the same leaders, and made a point of noting who they were denouncing so I could follow suit. We both fought Japan (independently). We declared friendship with each other and I provided favourable trades. Which worked, but the downside is that the majority of these were not directly, or even indirectly, under my control.