replace i5 with i7 cpu in mid2012 MBP
No. The CPU is welded on the motherboard. You can't replace it with your own. 

The only upgrade you can do on your own is changing RAM, hard drive, and replacing optical drive with a second hard drive, if you need.