Is an underline a form of punctuation?

Underlining is not punctuation, but a typographical device used for emphasis:

Emphasis (typography)

Underline

Professional Western typesetting usually does not employ lines under letters for emphasis within running text, because it is considered too distracting. Underlining is, however, often used with typewriters, in handwriting and >with some non-alphabetic scripts. It is also used for secondary emphasis, i.e. marks added by the reader and not the author.

An underscore is a character, not punctuation. Although it is sometimes referred to as 'underline', a term dating back to when the underscore 'character' was used to underline words on typewriters. These days underscores are mostly used in passwords, e-mail addresses and the like.

The symbol underscore [ _ ] (also called underline, underbar, low line, or low dash) is a character that originally appeared on the typewriter and was primarily used to underline words. To produce an underlined word, the word was typed, the typewriter carriage was moved back to the beginning of the word, and the word was overtyped with the underscore character.

Either way your friend was incorrect. If you are referring to the underline on a piece of work this is a typographical device of emphasis (not punctuation) and if you are referring to 'the underscore' then this is a character and also not punctuation.