  We present a coherent theoretical framework for computing gravitational
lensing effects and redshift-space distortions in an inhomogeneous universe and
investigate their impacts on galaxy two-point statistics. Adopting the
linearized FRW metric, we derive the gravitational lensing and the generalized
Sachs-Wolfe effects that include the weak lensing distortion, magnification,
and time delay effects, and the redshift-space distortion, Sachs-Wolfe, and
integrated Sachs-Wolfe effects, respectively. Based on this framework, we first
compute their effects on observed source fluctuations, separating them as two
physically distinct origins: the volume effect that involves the change of
volume and is always present in galaxy two-point statistics, and the source
effect that depends on the intrinsic properties of source populations. Then we
identify several terms that are ignored in the standard method, and we compute
the observed galaxy two-point statistics, an ensemble average of all the
combinations of the intrinsic source fluctuations and the additional
contributions from the gravitational lensing and the generalized Sachs-Wolfe
effects. This unified treatment of galaxy two-point statistics clarifies the
relation of the gravitational lensing and the generalized Sachs-Wolfe effects
to the metric perturbations and the underlying matter fluctuations. For near
future dark energy surveys, we compute additional contributions to the observed
galaxy two-point statistics and analyze their impact on the anisotropic
structure. Thorough theoretical modeling of galaxy two-point statistics would
be not only necessary to analyze precision measurements from upcoming dark
energy surveys, but also provide further discriminatory power in understanding
the underlying physical mechanisms.
