Who Killed the giant Goliath? We read in 1 Samuel 17: "David killed Goliath"


  And as he talked with them, behold, there came up the champion, the
  Philistine of Gath, Goliath by name, out of the ranks of the
  Philistines, and spake according to the same words: and David heard
  them. 1 Samuel 17:23 ASV


(...) 


  Then David ran, and stood over the
  Philistine, and took his sword, and drew it out of the sheath thereof,
  and slew him, and cut off his head therewith. And when the Philistines
  saw that their champion was dead, they fled. 1 Samuel 17:51 ASV


But we read in 2 Samuel 21: "Elhanan killed the giant Goliath"


  And there was again war with the Philistines at Gob; and Elhanan the
  son of Jaareoregim the Beth-lehemite slew Goliath the Gittite, the
  staff of whose spear was like a weaver’s beam. 2 Samuel 21:19 ASV


So, who killed Goliath?
According to this article the discrepancy is most likely a simple copyist error of a single letter causing confusion.  David killed Goliath, and Elhannan killed Goliath's brother. 1 Chronicles 20:5 (which repeats this verse) says:


  5 And there was again war with the Philistines, and Elhanan the son of Jair struck down Lahmi the brother of Goliath the Gittite, the shaft of whose spear was like a weaver's beam. 


There are no serious biblical inerrantists (and I do not consider myself an inerrantist at all) that say that there are no copy errors in the bible. Inerrancy is only ascribed to the original manuscripts. A quick reading of a good apparatus will reveal this to be a common (and minor) copy error, as understood even by an inerrantist.