The purpose of horns was to help young grubs navigate in the brooding caverns. When they are young, a trolls horns are soft and slightly fuzzy and very sensitive to help them feel their way around. After they pupate their horns harden and become much less sensitive. There is no real use for horns in their current state however they can be used for stimulation during pailing if that wasn't already obvious.
The red part of the horn, the base, is the most sensitive and if squeezed hard enough can make the troll pass out and allow you to do whatever. The middle orange part is very relaxing to trolls and moirails will, with permission, rub this part to help calm the troll on the other half of their quadrant or to help ease pain. Trolls, depending on personally, can be very offended if you attempt to touch their horns without permission. The yellow part of the horn is not very sensitive and if touched the troll cannot feel much of anything. Its more like a light tingling or faint pressure and less of a stimulation. If a troll lets you touch their horns, they either trust you or you're in their red, black, or pale quadrants.
Next chapter will be results of pupation. Thanks for reading! If you have questions or comments I will always answer.

YOU ARE READING
My Headcannons for Troll Anatomy.
AcakI will be describing my headcannons for the physical attributes of trolls from Andrew Hussie's: Homestuck.