I give a brief wave as an acknowledgment of riders coming toward me, I usually get a reply but not always, it doesn't bother me though. My waves are very brief so there is always the possibility they didn't see it.
When approaching another rider I don't say anything as this could startle them, so I sit back a few metres until safe to pass, give a wide berth, say hello and keep riding.
If we are going a similar pace I might have a chat for a few minutes, if they are receptive, and then go separate ways.
I mainly ride in the country so riders are few and far. If I lived in the city I probably wouldn't bother waving as there are too many bikes.
BTW, Since I started racing I don't bother trying to catch someone ahead or drop someone I have passed. Someone going slow is not necessarily a slow rider, they are probably have a recovery ride or training ride. There are no laws saying you can't use your race (expensive) bike for those days.
CHEERS.
Mark