When i use an external keyboard all the keys work good
With you replacing the internal keyboard and it still happening and a known good external not doing it, you are looking at two things:
1. The connector on the motherboard is bad (which usually isn't the case)
2. The keyboard you just bought (internal) is DOA or not seated good.
Double-check your connections and make sure that everything is good and snug and didn't come loose by accident.
Was anything spilled on the keyboard before replacing it?
Honestly it's hard to say. Let me check on DELL's site and see what the motherboard would cost if you got it direct through them.
I'll update my post when done.
I did manage to find a reputable dealer that has the motherboard for this computer. DELL doesn't offer a spare part for the motherboard because they are primarily considered FRUs (Factory Replaceable Units).