What is the device resembling a capacitor in my ceiling fan?
They are capacitors made by Seika to be compact to fit into enclosed spaces. Testing caps is very easy

You have to be careful when dealing with caps because they are essentially quick charge/discharge batteries and are capable of giving you a zap with the power off. The the resistor on the diagram of the cap indicates  that it discharges itself when the power is off, but it's still best to be cautious. If you test and it fails they are available for replacement.

This is an example of one on Amazon, however this is a triple cap. And to clarify the second one is also a capacitor, it's a 4 micro farad run capacitor.