I was wondering about this but can I use a keyboard that came from a Sony PCG-R505EL laptop to a Sony PCG-R505ESP laptop? I saw a seller on Ebay is selling a keyboard for the PCG-R505EL and it looks exactly the same as my keyboard. I have the PCG-R505ESP laptop from Sony.

You are taking an chance on it. Normally on all laptop, there should be a sparepart number written some where on the underside of the keyboard. If it's the same spare part number, then you should be fine.