Hello!
One of the most basic examples of relative dating, specifically in this case, would be the law of superposition. This simply states that out of many layers of rock, the oldest would be at the bottom and the youngest on top, so therefore the age of the fossils inside the rock would also increase when going down the layers. Therefore, we see that layer a is the oldest, and layer g is the youngest.
This disproves the first answer choice - the fossils in layer g are the youngest, not the oldest. Now, when comparing Layer F and D, we see that the rock layer F is above layer D. This means that layer F is younger than layer D (and same for the fossils in those respective layers). The third choice is incorrect as layer A would be older than F as it is beneath layer F.
Therefore, this means your second choice, or the fossils in layer F are newer than the fossils in layer D, is correct.
Hope this helps!