Solution (source code)

= Solution

Read the $2n+1$ colours from left to right. If every neighbouring pair had the same colour, <mathematical induction> would make every point the same colour as $-1$, contradicting the different colour of $1$. Therefore at least one adjacent pair has different colours.