Who killed Jeremy ?
Jeremy was killed.
Peter claims that Tom is guilty.
Tom says that Ralph is guilty.
John swears he didn't kill Jeremy.
Ralph says that Tom is lying.
If only one person is telling the truth,
Who killed Jeremy?
John Killed Jeremy.
Ralph is telling the truth, "Tom is lying".
Hence Tom is lying about Ralph being guilty.
and Peter is lying about Tom being guilty and
John is lying about he being innocent, hence he is guilty.