I understand that not all of 1 John 5:7 was originally written by John. How can that be?
Your question is in fact about the nature and purpose of textual criticism,* which happens to be a complex and difficult subject. Let me quote the passage from the original language, bracketing the section that is not original: "[verse 7] For there are three who testify [in heaven, the Father, the Word, and the Holy Ghost: and these three are one (verse 8). And there are three that bear witness in earth], the Spirit, the water and the blood; and the three agree."
Textual criticism is an attempt to differentiate among the different textual variants or readings of the biblical text in order to identify what was probably the original reading. Confused? Let me explain.
First, textual criticism is based on the fact that we do not have the original documents written by the biblical writers. For instance, we do not have the book of Acts as it came from the hands of Luke, only copies of it.
Second, we have more than 5,000 Greek manuscripts of the New Testament, and when we compare them with each other we find in many cases additions, deletions, and other types of changes. We call those variant readings.
Textual criticism analyzes those differences to determine which ones were later additions or modifications made to the original, as well as the possible reasons for the changes. Most of the changes were accidental, but some were done intentionally, supposedly to clarify the meaning of the original text.
How do scholars go about determining the original reading of a biblical passage? They use three lines of evidence: the Greek manuscripts, quotations of the New Testament in early Christian writings, and early Bible translations (e.g., Latin, Syriac, etc.). The process takes into consideration, among other things, the date and internal quality of the manuscript, presupposing that a very early date could preserve a more original reading. Generally, the more difficult reading is considered to be original because scribes tended to add to the text to "clarify" it.
Consequently, a shorter reading tends to be preferred over a longer one—although in some cases the scribes accidentally skipped words or phrases, and in other cases they dropped parts of verses they considered irrelevant or repetitious. They sometimes replaced uncommon words with more common ones, softened grammatical constructions, and made the text easier to read.
Textual critics also take into consideration the scripture itself as a criterion in the selection of the original reading. In the context of the whole biblical book, what would the writer most likely have written, considering the vocabulary, the style, and the context?
There is general agreement that textual variants do not affect any of the biblical doctrines.
In the case you cite, we know quite well what happened. The bracketed section shows up for the first time in manuscripts of the Latin version only after A.D. 600. It is not found in Greek manuscripts until after A.D. 1400. Henceforth, according to the experts, it is found in four Greek manuscripts as a translation from the Latin and inserted into the Greek text. The addition is not found in any of the other ancient versions.
How did it become part of the Greek text? Here is "the rest of the story."
When Erasmus published his version of the Greek New Testament, he left out the additions to 1 John 5:7 from his first two editions (1516, 1519), arguing that he could not find those words in any Greek manuscript. Pressured by some to include this addition to the Greek text, Erasmus proposed that if they could show him a single Greek manuscript in which the addition was found, he would include it in his next edition.
Sure enough, they came up with a Greek manuscript in which the addition was found, one scholars believe was dated from the sixteenth century A.D., translated from the Latin to the Greek and added to the Greek text. Erasmus subsequently included it in his 1522 edition of the Greek New Testament.
The Trinity is a biblical doctrine, and you can preach about it. But you should not use this text.
*In this context the word "criticism" means "analysis."