We demonstrate a multi-function fiber laser based on cross-gain modulation in a semiconductor optical amplifier (SOA). Depending on the input signals, the fiber cavity can emit a continuous wave (CW) laser, mode-locked pulses, or act as a clock recovery device. With an extra CW light overcoming the pattern effect in the clock recovery process, a 10-GHz synchronous clock sequence with <0.1 power fluctuation and <120-fs timing jitter is extracted from the transmission return-to-zero data stream. We further analyze the recovered clock properties as a function of the input signal, and find that the clock recovery system presents good stability over a large range of input signal characteristics. The multi-function fiber laser exhibits the advantages of compact configuration and low cost, which is very convenient and attractive for optical communications and signal processing.