Given: $x^2+x+1$ is divisible by $3$.
Case $I:$ $x=3m$
$\therefore 9m^2+3m+1$
$\therefore$ Not divisible by $3$.
Case $II:$ $x=3m+1$
$\therefore 9m^2+9m+3$
$\therefore$ Divisible by $3$.
Case $III:$ $x=3m+2$
$\therefore 9m^2+15m+7$
$\therefore$ Not divisible by $3$.
If $x^2+x+1$ is divisible by $3$, $x=3m+1$
$\therefore$ Remainder $=1$