This invention relates to an optical amplifier capable of adjusting the gain curve to a desired shape. This invention also relates to a fiber light source capable of producing desired output spectrum. The method to use passive wavelength filters for the gain flattening of erbium doped fiber optical amplifier is well known. However, the disadvantage with this method is that the gain curve varies depending on input optical signal power, gain level or changes in surrounding temperature. However, the optical amplifier of the present invention provides desired shapes of gain curves at various gain levels in spite of the reconfiguration of optical communication networks or the changes in driving conditions since the amplifier includes an active wavelength tunable filter and a gain detection system. The fiber light source of the present invention operates without external input light, producing spectrum-sliced output light from amplified spontaneous emission.