It is vital to socialize your dog when she is a puppy... Expose her to children and other dogs at a early age so she gets use to it and comfortable. It is harder to do it when the dog is older
I am surprised that a vet would recommend a shock collar. IMO those things are terrible. Especially for a small breed. I would be looking for a new vet ! NO, I would never consider using one of those
Instead , gradually , work with your dog in short intervals , as soon as she "acts up" remove her from the situation . She has to build confidence and trust.. Use consistency and a whole lot of patience with her. If and when she does respond well , reward her with a small treat. This is very time consuming, but she will eventually catch on .