Questions & Answers about Í fyrstu skildi ég þetta ekki, en nú skil ég það.
It means at first or initially.
In this sentence, í fyrstu contrasts with nú:
- í fyrstu = at first
- nú = now
So the sentence is built around a clear time contrast: first one situation, now a different one.
Because í fyrstu is a fixed expression.
More literally, fyrstu is an inflected form of fyrstur (first), and it appears here after the preposition í. You do not need to analyze it every time you see it; the most useful approach is simply to learn í fyrstu as a chunk meaning at first.
A learner will also see fyrst by itself in other contexts, but in this sentence í fyrstu is the natural phrase.