Breakdown of Det er en venn.
være
to be
det
it, that / there (in 'there is/are')
en
a, an (masculine indefinite article)
vennen
the friend
Questions & Answers about Det er en venn.
Why do we use det (it) when talking about a person?
Just as English says "Who is it? — It's a friend", Norwegian uses Det er ... to identify or introduce someone. Here, det simply points to the person ("it" or "that"). Once you have introduced who it is, you normally switch to han (he) or hun (she) in the next sentence: Det er en venn. Han heter Per. (It is a friend. His name is Per.)
What question does Det er en venn answer — Hvem er det? or Hva er det?
It answers Hvem er det? (Who is it? / Who is that?), because a friend is a person. You use hvem (who) to ask about people and hva (what) to ask about things. Notice how the word order flips between the two: the question puts the verb er before det (Hvem er det?), while the answer puts det first (Det er en venn).
Why is it det when en venn is a masculine noun?
Does en venn mean any friend, or only a male friend?