Question: is y vowel or consonant?
Answer: The result is a vowel-like consonant. Linguistically, the "sometimes" part of the grade-school lesson doesn't make sense, since the letter y is more commonly pronounced as a vowel. But its consonant sound is unique, and that seems to be why y is more often considered to be a consonant and only "sometimes" a vowel.