I don't understand the use of the character

I don’t understand the use of the character

こうこう = senior high school, and こうこうせい is senior high school student. ちゅうがくせい is junior high school student.

You’re confused, because there’s some unnatural word splitting in the lesson, which makes こうこう appear as こう こう .
The LingQ words splitter isn’t perfect, but it’s better than nothing. You’ll soon get used to it, though. Real Japanese doesn’t even use spaces anyhow.