Are there any open source applications that demonstrate good techniques of online-offline synchronization of databases, something like Remember The Milk does with their iPhone app, Google Gears offline mode, etc.?
google gears itself is open source. you'll want to look at the localserver module.
check out code.google.com/p/gears for the main developer site, and the LocalServer source. Although gears is a complex piece of software because it has lots of components (browser plugin interface, integration with javascript, SQLite integration, etc...), it is fairly well factored, so the LocalServer source is pretty easy to follow.
The Unison file synchronizer is a magnificent tool, but its source code is not for the faint of heart. You didn't ask for academic papers but I have written one I'm proud of. There was some perl code to go with that one but I'm not sure if it's of any use. If you want it send me an email.
I have experience with SymmetricDS and it is really good. It can handle a lot of scenarios. It is open source, so it can be modified or extended for some special cases. As the authors say it was developed for a real life project so you can be sure that it really works fine (and it works for me also).
Just one thing. SymmetricDS relies on database triggers, so your database must support triggers.
The Wikipedia article on Operational Transform references four open-source applications - Ace, Gobby, Subetheredit and So6. Perhaps one of them is able to used as a starting point for you.
While they might not work directly with your DBMS of choice, it would be worth considering Operation Transform as the basis of your synchronisation.