Outlet not working before/after replacement
No one I know of can tell you exactly what's happening. From a troubleshooting aspect, your problem is probably a disconnected or loose wire. It can be either a neutral or hot wire.

The procedure to find the wire is to first find the circuit(s) that are having the problem. Then check for power at the breaker and check the neutral and ground at the buss for loose connections (warning this would require you to pull the cover off the panel and expose live conductors). Once you have established that the problem is not in the panel then you need to pull each device and fixtures on the circuit and examine them for loose connections. Also look for burn marks or damaged components. Make sure every splice is secure and making a sound electrical and mechanical connection. 

If your residence was wired by someone who used the push in back wire connection on the receptacles, remove them and reconnect to the screw lugs on the receptacle. You can probably go on youtube for the proper way to make a connection.

Remember you are looking for a loose or disconnected conductor so the problem may not be at the receptacle not working, but somewhere downstream of the problem. If all of this seems a little overwhelming, then you should consider to bring in a service electrician to assist you in finding the problem.

I should also mention that if you are removing covers and pulling components you can be exposing yourself to live parts and there is a risk of electrical shock or burn. So make sure everything is dead inside the boxes before pulling devices out for inspection.

Good luck