Q416:

If a creature leaves the melee range of a familiar, does the familiar get an opportunity attack?

If the Familiar is a pact of the Chain Warlock's Imp does that change things (they can attack IF you take the attack action and forgo one of your attacks)?

Does your chain pact familiar require the investment of the chain master to gain the opp attack ability?