how does ceiling fan remote implement reverse function?
The motor itself has more than two wires going to it. By reversing one pair you can reverse the motor. Here is a typical ceiling fan internal schematic (including light, reversing switch and speed control)- it's a split-phase motor with a run capacitor:



The reverse function from a remote control is probably accomplished with a DPDT relay (or perhaps multiple SPDT relays). 



For the answer to how it is done over two wires, see US patent #4,719,446 These are about the remote control function rather than specifically the reversing.