Character A finds a spell written on a wall and copies it. He takes the copy to character B who copies it into her spellbook or Book of Shadows for her future use. Assume the spell is one B can prepare and use. Character B is a wizard, a tome warlock, or has the ritual caster feat.
What must be true about A for this to be possible?
The best answer will cite sources and cover multiple cases with a simple TL;DR.