Electrical Questions? Ask an Electrician Online.
Hi, I'm Mike G and I'll be glad to assist you. In as much as the problem started with the installation of the ceiling fan, I suggest checking the connections in the ceiling outlet. Your description indicates a loose connection. If you have a 2 wire voltage tester, you can test to find out if the hot or the neutral is where the bad connection is.
When a circuit is installed, it runs from box to box. The connection leaving that box more than likely has a loose wire which doesn't affect anything connected ahead of it. Your description of the issue points to that conclusion. Got to check it.
If you have a tester, you can test a dead outlet when it happens to know which connection to look for the failure at. Let me know and I'll tell you how.