Solution:The sun is seen little before it rises and for short while after it sets due to atmospheric refraction. When light enters from vacuum to earth’s atmosphere, it basically enters from rarer to denser medium and bends towards horizon. During sunrise, when the sun is just below the horizon, our atmosphere causes the light rays to bend and we see the sun early.
Similarly, at sunset, the apparent position of the sun is visible to us and not the actual position due to the same bending of light rays effect.