I found almost that exact same image behind a bathroom vanity light fixture that I took down to replace. Needless to say I was flabbergasted that such garbage workmanship would be hidden behind a fixture.
You should look very closely at what is just behind the place where the romex cable is coming out one hole and reentering the wall cavity at the slot on the right.
Mine looked exactly like that and there was a stud right behind that cable loop.
I opened up a hole to the right of the stud for a suitable metal electrical box. I then drilled a hole through the center line of the stud from side to side and worked the wire through the hole. I then mounted the electrical box to the side of the stud and brought the electrical cable into the box and secured it with the box clamp at the rear of the box. Now it is properly wired but I had to work at finding the proper lighting fixture that would cover up the messy slot in the drywall. (I would have patched and painted it but decided to wait till I give this bathroom a facelift remodel in the near future.
Your fan is designed to be internally self-switched using the wireless remote. As such, it's looking for 3 wires:
- Equipment safety grounding/earthing, which is always green or bare (even in Thailand)
- Hot (of some kind), a current supply, which can be many colors
- Neutral, which is a current return, which must be white or gray. (white wires are often not neutral).
Grounds are easy because all grounds get connected together in every case, unless you're doing extreme wizard-work in a test lab, audio studio or factory.
When you see two cables entering, and both blacks are already tied together, and both whites are tied together, that circuit is carrying current onward to some other point-of-use. "It's not yours to disassemble" is probably the best way of thinking about it. We have another question today where someone dismantled one of those, and it turns out it also served his neighbor's apartment.
However, you can tap it, by adding your own wires to the bundle. Usually when it's a simple 2-black and 2-white (or 3-3, 3-4 or any nearly equal number) in a bundle, you can count on the whites being actually neutral. So voilĂ , we have found where to attach your fan's neutral wire: add it to the bundle.
We don't quite know what those black wires are. They may be always-hot; they may be switched-hot off a mystery switch. It would help if we knew where the onward wires go, because builders don't install wires unnecessarily. Regardless... these are the only "hot" wires in the box, so they are our only choice for the fan. The fan's black wire gets added to this bundle.
That's the best we can do. Expect one of your do-nothing switches to start doing something. This may not play well with the remote.
Best Answer
The question depends entirely on whether the fixture acts as its own junction box, with full containment and a strain relief clamp. If it includes a UL listed enclosure, all good. The instructions should make this fairly clear.
If not, grab an old work (remodeler) box and pop it in. Be sure you'll clear your studs before you start cutting drywall.