A self-confessed paedophile was involved in online exchanges in which he tried to arrange the potential rape of a child with what he thought was a teacher.