Here’s something to read about the formation of the concept of trinity. It was not part of the early church.
Tertullian - the Father Of Christian Trinitarianism
Tertullian (c. 150 - c. 225 A.D.) was the first person recorded by history to use the words trinity (Latin: trinitas), substance (substantia), and person (persona) in relation to God.  He was the first to speak of three persons in one substance (Latin: una substantia et tres personae). Tertullian adhered to the economic conception of the trinity. That is, he believed that the trinity exists for the purpose of revelation only, and after this has been accomplished the distinctions between the persons will cease. However, he definitely differed from Irenaeus in that he used the Logos doctrine of the Greek apologists. Tertullian equated the Logos with the Son. He believed the Father brought the Logos into existence for the creation of the world and the Logos was subordinate to the Father. The doctrine of the trinity posed no problem for Tertullian, for his whole theology rested on the thought that the more impossible the object of faith is, the more certain it is. He has been characterized by the statement, "I believe because it is absurd."
Other Early Trinitarians
Tertullian introduced the terminology of trinitarianism and became its first great proponent in the West, but Origen (died 254) became its first great proponent in the East.  Origen attempted to fuse Greek philosophy and Christianity into a system of higher knowledge that historians often describe as Christian Gnosticism. He accepted the Greek Logos doctrine (namely that the Logos was a person separate from the Father), but he added a unique feature not proposed until his time. This was the doctrine of the eternal Son. He taught that the Son or Logos was a separate person from all eternity. Furthermore, he said the Son was begotten from all eternity and is eternally being begotten. He retained a subordination of the Son to the Father in existence or origin, but moved closer to the later doctrine of co-equality.
Origen had many heretical beliefs due to his acceptance of doctrines from Greek philosophy, his emphasis on mystical knowledge rather than faith
The Council of Nicea
By the end of the third century, trinitarianism had replaced modalism (Oneness) as the belief held by most of Christendom, although the early views of trinitarianism were not yet in the form of the modern doctrine.
During the early part of the fourth century, a great controversy about the Godhead came to a climax - the clash between the teachings of Athanasius and Arius. Arius wished to preserve the oneness of God and yet proclaim the independent personality of the Logos. Like the trinitarians, he equated the Logos with the Son and with Christ. He taught that Christ is a created being - a divine being but not of the same essence as the Father and not co-equal with the Father. In other words, to him Christ is a demigod.
In effect, Arius taught a new form of polytheism. Arius was definitely not a Oneness believer, and the modern Oneness movement strongly rejects any form of Arianism.
In opposition to Arius, Athanasius took the position that the Son is co-equal, co-eternal, and of co essence with the Father. This is now the view of modern trinitarianism. Therefore, while Tertullian introduced many trinitarian concepts and terms to Christendom, Athanasius can be considered the true father of modern trinitarianism.
When the Arian-Athanasian controversy began to sweep across the
By establishing Christianity as the preferred religion of the Roman Empire (which ultimately led to it becoming the official state religion),
When the Council of Nicea convened,
"Constantine, who treated religious questions solely from a political point of view, assured unanimity by banishing all the bishops who would not sign the new professions of faith. In this way unity was achieved. It was altogether unheard of that a universal creed should be instituted solely on the authority of the emperor… Not a bishop said a single word against this monstrous thing." 
Heick divides the participants at Nicea into three groups: a minority of Arians, a minority of Athanasians, and a majority who did not understand the conflict but wanted peace.  The Council finally adopted a creed that clearly denounced Arianism but said little in the way of positive trinitarian teaching. The key phrase stated that Christ was of the same essence (Greek: homoousios) as the Father and not just of like essence (homoiousios). Interestingly enough, the modalists (Oneness believers) had first used the chosen word (homoousios) to express the identity of Jesus with the Father. Many who unsuccessfully advocated the use of the latter term (homoiousios) did not really mean that Jesus was different from the Father in substance, but rather they wanted to avoid the Oneness implications of the former term. So the resulting creed was a clear rejection of Arianism, but a not-so-clear rejection of modalism (Oneness).
The original version of the Nicene Creed formulated by the Council of Nicea in relation to the Godhead is as follows:
"We believe in one God, the Father Almighty, maker of all things visible and invisible. And in one Lord Jesus Christ, the Son of God, begotten of the Father, only begotten, i.e., of the nature of the Father. God of God, Light of Light, very God of very God, begotten, not made, of one substance with the Father, by whom all things were made, both things in heaven and things on earth; who for us men and for our salvation came down and was made flesh and assumed man's nature, suffered and rose the third day, ascended to heaven, (and) shall come again to judge the quick and the dead. And in the Holy Ghost. But the holy and apostolic church anathematizes those who say that there was a time when he was not, and that he was made from things not existing, or from another person or being, saying that the Son of God is mutable, or changeable." 
There is no clear statement of the trinity in this creed, but it does affirm that Jesus is of one substance with the Father in opposition to Arianism. There is no reference to the Holy Ghost as a separate person in the Godhead, but it merely expresses a belief in the Holy Ghost. This original Nicene Creed indicates a personal distinction between Father and Son and states that the Son is not mutable or changeable. This last phrase is a departure from the biblical doctrine of the Son and supports modern trinitarianism since it teaches an eternal Son. Basically, then, the Council of Nicea has a threefold significance: it is a rejection of Arianism; it is the first official declaration incompatible with modalism (Oneness); and it is the first official declaration supporting trinitarianism.
The trinitarian victory of Nicea was not complete, however. The next sixty years were a seesaw battle between the Arians and the Athanasians. Some participants in the council such as Marcellus, bishop of
Athanasius was banished five or six times during this period. Much of the conflict was due to political circumstances. For example, when
This one is also good if you want to read more: