An all-fiber comb filter using a tapered-erbium-doped fiber in a Mach-Zehnder interferometer structure is presented. The free spectral range, extinction ratio, bandwidth, and interference pattern of the comb filter can be shaped by controlling the taper waist length and the length of up and down taper transition regions. By varying the taper waist length from 5 to 25 mm, the free spectral range changes from 14.7 to 1.0 nm, and the linewidth varies from 3.3 to 0.3 nm, respectively. We demonstrate a tunable dualwavelength laser by using the tapered-erbium-doped fiber as a gain medium as well as a wavelength-selective element. The laser can be tuned at a resolution of 0.2 nm with a side-mode suppression ratio of up to 46.88 dB and a linewidth of 0.09 nm.