  X-ray point sources in galaxies are dominated by X-ray binaries (XRBs) that
are variables or transients and whether their variability would alter the X-ray
luminosity functions (XLF) is still in debate. Here we report on NGC 7331 as an
example to test this with 7 Chandra observations. Their detection limit is
7$\times10^{37}$ erg s$^{-1}$ in the 0.3 -- 8.0 keV energy range by assuming a
power-law spectral model with a photon index of 1.7. We detected 55 X-ray
sources. Thirteen of them are variables for which 3 of them are transients and
some of the sources possess a bimodal luminosity-hardness ratio feature, which
is often observed among X-ray binaries. Nine more ultra-luminous X-ray sources
are found comparing to previous studies and 8 are likely to be low-mass or
high-mass XRBs. Twenty-one optical counterpart candidates are found based on
the Hubble Space Telescope images, but we cannot rule out the possibility of
positional coincidence. The spectral analysis of SN 2014C shows a trend of
increasing soft photons and decreasing hydrogen column densities as its outer
shell expands. We fit the 7 incompleteness-corrected XLFs to both a power-law
(PL) and a power-law with an exponential cut-off (PLC) model using Bayesian
method, which is the first time used in XLF fitting. The hierarchical PLC model
can describe the XLF of NGC 7331 best with a slope of $\sim$ 0.5 and a
luminosity cut-off around 8$\times$10$^{38}$ erg s$^{-1}$. This study proves
that multi-epoch observations decrease the deviation due to the variable
luminous sources in XLFs.
