Last week, month etc. is the week, month just before this one. The last week, month etc. is the period of X days up to the moment of speaking.
I was in Paris last week.
I have had a cold for the last week.
I have been busy for the last three weeks.
Sometimes the last means the last in a series.
If you want to say that something happened during this period, you say that it happened in the last three weeks or during the last three weeks.
He had asked himself that question at least a thousand times in the last eight days.
Something funny happened in the last week of the holidays.
If you don't say the number, you can say
Many changes have been made in the last few years.
Or use recent instead. For example, you can say
Many changes have been made in recent years.
Interest in golf has grown rapidly in recent years.
The past+ a noun is used to refer to the period up until now. ("their activities over the past two years").
During the past two weeks ten people have died of the desease. She has been feeling tired for the past three days.
The sources are Longman Exams Dictionary, M. Swan PEU, Collins COBUILD English Usage
I think it is clear that you should use prepositions in your sentences."For"(to say how long),during,in,over (something goes on within a period of time) would do.
I'm not sure what is proper, but in everyday speaking I've never heard "on" in that context.
While thinking about it a bit, I moved his position:
He was waiting for me on the bottom of the stairs.
Which doesn't sound right, but also doesn't really tell me where he is. I'd almost expect him to be stuck under the staircase like a sticker.
Thinking and researching a bit more, it seems the target indicates which to use, and the rules are pretty vaguely defined. The answers to this question seem to suggest that has to do with the distinction between and surface and an upright target, which I think I agree with (the examples given there might not show that, however, because in that context they also show a difference in intent vs. final resting place)
So, to compliment our "at the top of the stairs" example:
He was waiting for me on the second floor
The expiration date is printed on the top of the jar (I'd expect it to be on the lid)
The expiration date is printed at the top of the jar (I'd expect it to be on the jar itself, near the top)
He was waiting for me on top of the house
He was waiting for me on the roof
Note that at is often used to be more specific about the position/location of the subject.
He was waiting for me at the top of the ladder
He was waiting for me on the ladder.
In the last one, we know he is on the ladder, but we don't know which rung he is at.
Best Answer
I disagree with Ekn.
"For the first few days" implies that something was going on continuously for days. While technically you probably thought about other things during those first few days, like eating and going to the bathroom, it is metaphorically valid, and certainly better in a literary since, to say that it was continuously ongoing. I would absolutely vote in favor of using "for" here.
However, "in" is not invalid. It says to me that at any time in those first few days that you attempted to figure it out, you couldn't, but not necessarily that you did so a lot for those first few days.
So both are valid, but in the context of a breakup I would use "for".