One of Us is Lying - Karen  M. McManus

From the blurb:

 

Five student walk into detention. Only four leave alive.

 

There seems to be a murder most foul.