  We investigate the future evolution of the dark energy universe in modified
gravities including $F(R)$ gravity, string-inspired scalar-Gauss-Bonnet and
modified Gauss-Bonnet ones, and ideal fluid with the inhomogeneous equation of
state (EoS). Modified Friedmann-Robertson-Walker (FRW) dynamics for all these
theories may be presented in universal form by using the effective ideal fluid
with an inhomogeneous EoS without specifying its explicit form. We construct
several examples of the modified gravity which produces accelerating
cosmologies ending at the finite-time future singularity of all four known
types by applying the reconstruction program. Some scenarios to resolve the
finite-time future singularity are presented. Among these scenarios, the most
natural one is related with additional modification of the gravitational action
in the early universe. In addition, late-time cosmology in the non-minimal
Maxwell-Einstein theory is considered. We investigate the forms of the
non-minimal gravitational coupling which generates the finite-time future
singularities and the general conditions for this coupling in order that the
finite-time future singularities cannot emerge. Furthermore, it is shown that
the non-minimal gravitational coupling can remove the finite-time future
singularities or make the singularity stronger (or weaker) in modified gravity.
