Does Q know about the prophets, since he was once on DS9 so close to the Bajoran worm hole?
Had he ever met them, or commented on them?
We don't know. Certainly Q has visited DS9 (in Q-less) but he never mentioned the prophets nor has made any reference to them in his prior visits to the Enterprise or subsequent visit to Voyager. It would seem highly likely that he would know (given that the Q evidently know pretty much everything and that he's being dragged toward the wormhole at an alarming speed) but it's not certain.
Here's where things get interesting. Not only are the Q aware of the Prophets but within the new IDW comic series ("The Q Gambit, Part 6") we learn that Prophets have powers that the Q lack, notably the ability to not simply travel through time, but also to perceive events across multiple dimensions.
In canon we don't strictly know.
Memory Alpha describes the Prophets as:
The Prophets, also known as "wormhole aliens" (mainly by non-Bajorans), were non-corporeal extra-dimensional entities that resided in the only stable wormhole known to exist, in the Bajoran system.
Considering how far reaching Q's powers were and that he's had pretty much an eternity to look around, he's probably either encountered them or has suspicions of their existence.
Out of canon, most probably
Memory Alpha says the following (referring to non-canon instances):
The Prophets also played a small role in the final book of the Q Continuum trilogy. During the ancient battle between the allies of 0 and the Q Continuum, 0's ally Gorgan attempted to escape his opponent Q through the Bajoran wormhole, only to be denied entry by the Prophets. Ancient Bajorans observed the battle between the two incredible powers, and sensed that they were neither the Prophets nor the Pah-wraiths.
And, more definitively:
The Prophets are witnessed in the future of the alternate reality created by Nero, when Q brings the Enterprise into their future in the storyline The Q Gambit, where all but one of the Prophets have been wiped out by the Pah-Wraiths, and the surviving Prophet is trapped in the tablet that was used for the Reckoning. In the course of their time in the future, the Prophet is released and possesses Spock, who realizes that the power of the Pah-Wraiths can be overcome if the Prophet possesses Q, elevating Q's power to an even further level.
This last bonded instance provides fairly strong evidence that Q would know about the Prophets.
Watching TNG "Encounter at Farpoint", after they split the disc section away so that the warp section could turn around and face Q, Miles O'Brien is on the battle bridge but isn't taken by Q although everyone else on the battle bridge is taken to the 21st century court. At no stage does Miles get taken or mentioned, almost like Q is actively avoiding Miles and leaving him out of his meddling with the humans.
My theory is that Q was aware of the Prophets and was told to stay away from Miles because of his involvement with the events that would unravel in the battle to come involving Sisko, the Prophets and the Pah-wraith.
Seems that although he boarded DS9 because of Vash, maybe he had heard of "The Sisko" and thought he would meddle whilst he was on board - we know how brash he is, and seeing how quickly he ultimately withdrew never to be seen again after fisty cuffs with Sisko, seems odd knowing that he was happy to screw with the TNG crew for several years.