Could a loose connection be causing my ceiling fan to work intermittently?
Likely so, yes. A loose connection is quite dangerous- you could be getting arcs, which can start fires. I would recommend against using the fan until you can check the connections.

More and more state and local electrical codes are requiring arc fault circuit interrupt breakers. While they're more expensive, they really do work to prevent fires.