NOVELTY - A polyimide comprising a repeating unit having sulfonic acid group at the terminal of side chain and also comprising a reactive blocking group derived from a monoamine compound or monoanhydride compound having at least one carbon-carbon double bond at a terminal or at both terminals is new.    USE - In polymer electrolyte useful in fuel cell (claimed), e.g. a hydrogen or direct methanol fuel cell.    ADVANTAGE - The polyimide has high ionic conductivity and good structural stability; good hydrogen ionic conductivity due to a high density of a sulfonic acid at a side chain while retaining inherent good thermal resistance and mechanical properties; does not decompose even under low humidity, and is inexpensive. The fuel cell comprising the polymer electrolyte having the polyimide does not exhibit much swelling, has a high ionic conductivity even under low humidity, and good electrical and mechanical properties.    DETAILED DESCRIPTION - A polyimide comprising a repeating unit of formula (I) and a reactive blocking group derived from a monoamine compound or monoanhydride compound having at least one carbon-carbon double bond at a terminal or at both terminals is new.    X = group of formula (i) or (ii);    Y = group of formula (iii) or (iv);    X1 - X8 and Y1 - Y8 = H, halogen, 1-30C alkyl or alkyl halide, 6-30C aryl or aryl halide;    Q1 and Q2 = bond, O, CO, SO2, S, (T)a, (OT)a, (TO)a or (OTO)a;    T = alkylene (substituted with halogen, 1-10C alkyl halide or arylene (substituted with at least one halogen or 1-10C alkyl halide));    a = 1 - 10;    R1 and R2 = H or a monovalent organic group of formula (v);    m = 10 - 1000;    n = 1 - 5.    Provided that both R1 and R2 are not H.    INDEPENDENT CLAIMS are included for the following:    (1) preparation of the polyimide; and    (2) a polymer electrolyte prepared either by curing the polyimide or a mixture of the polyimide and a polyamic acid having a repeating unit of formula (II) or soluble polyhydroxyimide having a repeating unit of formula (III) and comprising a reactive blocking group derived from a monoamine compound or monoanhydride compound having at least one carbon-carbon double bond at a terminal or at both terminals.    Y' = group of formula (vi) or (vii);    Y9 - Y12 = Y1.