I want to play this song on the piano and I don't know the meaning of the dashed line connecting the two F notes in measures 8 and 16.
It's a "voice leading line". Use is sometimes a bit ambiguous, meaning either a musical or an execution suggestion. You might want to take both and play it with the right hand as a continuation of the right hand melody line. That would likely imply sorting out the fingering of the preceding passage to end on one of the fingers that make it natural to jump one octave down.
Of course, the continuation makes this a bit artificial. You still might want to try how it sounds since it usually is a bit easier to match character while using the same hand.