To explore whether a flat-band system can accommodate superconductivity, we consider repulsively interacting fermions on the diamond chain, a simplest possible quasi-one-dimensional system that contains a flat band. Exact diagonalization and the density-matrix renormalization group are used to show that we have a significant binding energy of a Cooper pair with a long-tailed pair-pair correlation in real space when the total band filling is slightly below 1/3, where a filled dispersive band interacts with the flat band that is empty but close to EF. Pairs selectively formed across the outer sites of the diamond chain are responsible for the pairing correlation. At exactly 1/3-filling an insulating phase emerges, where the entanglement spectrum indicates the particles on the outer sites are highly entangled and topological. These come from a peculiarity of the flat band in which "Wannier orbits" are not orthogonalizable.