You can get the class as early as Lady of the Night 10 by failing a skill check, but once you hit Lady of the Night 20, leave the brothel and return. You should enter dialogue with the madam and get the prostitute class