Peeves was a poltergeist. It generally irritated people and rather then helping them as well as making fun of them.
- Why was Peeves in the school?
- What is/was the job or work assigned to Peeves?
Science Fiction & Fantasy Stack Exchange is a question and answer site for science fiction and fantasy enthusiasts. It only takes a minute to sign up.
Sign up to join this communityPeeves was never a person, therefore it never had a job of work assigned to them.
JKR spoke to this issue directly on the FAQ on her old website
Q : Peeves chews gum, how can he when he is a ghost? (Nearly Headless Nick can't eat).
A : Peeves isn't a ghost; he was never a living person. He is an indestructible spirit of chaos, and solid enough to unscrew chandeliers, throw walking sticks and, yes, chew gum.
She's also provided some extra clarity in a Leaky Cauldron interview in 2005
ES: Why does Dumbledore allow Peeves to stay in the castle?
JKR: Can't get him out.
ES: He's Dumbledore, he can do anything!
JKR: No, no no no no. Peeves is like dry rot. You can try and eradicate it. It comes with the building. You’re stuck. If you've got Peeves you're stuck.
ES: But Peeves answers to Dumbledore -
JKR: Allegedly.
MA: Allegedly?
JKR: Yeah. I see Peeves as like a severe plumbing problem in a very old building, and Dumbledore is slightly better with the spanner than most people, so he can maybe make it function better for a few weeks. Then it’s going to start leaking again. Would you want Peeves gone, honestly?
MA: If I was Harry I might, but as a reader I enjoy him. I enjoyed him most when he started obeying Fred and George at the end of book five.
JKR: Yeah, that was fun. I enjoyed that. That was satisfying. [Laughter.]
The poltergeist is an invisible entity that moves objects, slams doors and creates other audible, kinetic disturbances. It has been reported in many cultures and there is a strong association with the places where young people, especially adolescents, are living. Explanations for the phenomenon vary all the way from supernatural to scientific.
It was inevitable that, in a building bursting with teenage witches and wizards, a poltergeist would be generated; it was likewise to be expected that such a poltergeist would be noisier, more destructive and harder to expel than those that occasionally frequent Muggle houses.
Source : Pottermore - Peeves