In Shakespeare's Romeo and Juliet, in Act 5 Scene 1 where Romeo encounters the Apothecary, is the role of the apothecary necessary, or could Shakespeare have Romeo obtain the poison without interaction?
You are probably correct. Romeo could have gotten the poison without the apothecary. Shakespeare simply could have written that Romeo had already obtained the poison and left no explanation as to how or from whom. The problem with that, in my opinion, is that audiences typically don't like it when things aren't explained and they are left to wonder. The apothecary is a simple and believable solution.
Shakespeare could have had the interaction be with Friar Laurence, but there's a problem with that. Romeo is buying poison to kill himself with. I doubt that as his friend and confidant, Friar Laurence would have given Romeo poison so that he could die. The friar has the knowledge, no doubt. He came up with the sleeping drug for Juliet. I'm sure a substance that makes you look dead but aren't dead is way harder than a substance that makes you look dead by actually being dead. Romeo knows that Friar Laurence will never do it for him, so Romeo is in need of someone to get poison from. Shakespeare needs the apothecary to fill that role.