The correct form of the sentence uses "in the few":
It happened in the few days before the meteor shower.
Imagine this as a response to the question "When did it happen?" The response is that it happened in (or during) the few days before the meteor showing. If you don't use in/during etc., you're not giving a time frame, so the sentence is incomplete. What this sentence says is that the event happened during any of the few days before the meteor shower.
Now if instead you modified the first sentence a bit and said:
It happened a few days before the meteor shower.
This means something a little different; it means that the event happened at the exact point of a few days before the meteor shower. The event happened, a few days passed, then there was a meteor shower. This has a bit of a different meaning than the first sentence, because "in the few days before" means that it could have happened at any time during those few days; it could have been the day before or two days before or an hour before.
In the diagram below, the first sentence, "in the few days before", means that it could have happened at any time between the two marked spots ("|") on the timeline. If it happened "a few days before", it happened exactly at the first mark on the timeline.
-----------|----------------------------|----------------------
///A few days before/////The meteor shower//////
The correct structure is the one with to+infinitive:
The reason for me to go there is obvious.
In order to make the first example acceptable, it should be altered like this:
The reason for my going there is obvious.
Best Answer
None of your sentences are "incorrect" but they have different meanings, and some of those meanings make more sense than others.
First of all, "the exam" in the singular obviously refers to one specific exam for one specific course. Usually we think of "an exam" as being a single test which is taken in a single session of a couple hours in length, so your sentences 1 and 2 are a little strange in that context... but it could be that the professor is lenient or the student has an accommodation which allows them to take the test at any time in a set period. It is also possible that the "exam" is a practical project or essay which has a set deadline but not necessarily a defined period in which it is taken.
So I will discuss the use of "the exams" in the plural, which refers to "the exam period"—that is, the time over which you expect to take several exams for several courses.
Not grammatically incorrect, but not the best phrasing. I would take this to mean "The exam period ends in only a few days." There is an implied "...to happen" at the end, which means that the exam period has started, and if you want to finish your exams on time you only have a few days left. This would make the most sense if the exam was a practical project rather than a written test, as I mentioned above.
Again, not grammatically incorrect. This one makes much less sense, though. It means that there is not much time left in which the exam period could start—which makes it sound like it is not pre-determined when they will start, only that the exams must be done with by such-and-such date, and the exam period is so long, and so the period must start by this-or-that date in order to not run over. This is not how it usually works; generally the exam period is scheduled even before the academic year starts, and that is when the exams will take place unless there is a very good reason otherwise.
These both make perfect sense and have the same meaning, which is: The exam period starts in only a few days.