A process for producing a polymer, characterized by comprising the following step (A) and step (B). (A) A step in which a polymer having repeating units represented by the general formula (1): -Ar1- (wherein Ar1 represents an arylene, divalent heterocyclic, or divalent aromatic amine group having at least one C-H bond on the aromatic ring) is used as a raw material and one or more of the C-H bond(s) on the aromatic ring are converted to thereby produce a polymer having repeating units which have one or more characteristic groups X and are represented by the general formula (2): (wherein X represents a characteristic group; Ar2 represents an arylene group, heterocyclic group, or aromatic amine group which each has a valence of n+2 and in each of which n of the C-H bonds on the aromatic ring of Ar1 have been converted into a C-X bond; and n is an integer of 1-4) (hereinafter, this polymer is referred to as polymer having the characteristic group (X)). (B) A step in which the polymer having the characteristic group (X) produced in the step (A) is reacted with a compound having a characteristic group (Y) which reacts with the characteristic group (X) to form a bond.