  Motivated by the recently reported signatures of superconductivity in
trilayer La$_4$Ni$_3$O$_{10}$ under pressure, we comprehensively study this
system using {\it ab initio} and random-phase approximation techniques. Without
electronic interactions, the Ni $d_{3z^2-r^2}$ orbitals show a
bonding-antibonding and nonbonding splitting behavior via the O $p_z$ orbitals
inducing a ``trimer'' lattice in La$_4$Ni$_3$O$_{10}$, analogous to the dimers
of La$_3$Ni$_2$O$_{7}$. The Fermi surface consists of three electron sheets
with mixed $e_g$ orbitals, and a hole and an electron pocket made up of the
$d_{3z^2-r^2}$ orbital, suggesting a Ni two-orbital minimum model. In addition,
we find that superconducting pairing is induced in the $s^{\pm}$-wave channel
due to partial nesting between the {\bf M}=$(\pi, \pi)$ centered pockets and
portions of the Fermi surface centered at the {\bf $\Gamma$}=$(0, 0)$ point.
With changing electronic density $n$, the $s^\pm$ instability remains leading
and its pairing strength shows a dome-like behavior with a maximum around $n =
4.2$ ($\sim 6.7\%$ electron doping). The superconducting instability disappears
at the same electronic density as that in the new 1313 stacking
La$_3$Ni$_2$O$_7$, correlated with the vanishing of the hole pocket that arises
from the trilayer sublattice, suggesting that the high-$T_c$ superconductivity
of La$_3$Ni$_2$O$_7$ may $not$ originate from a trilayer- and single-layer
structure. Furthermore, we predict an interesting spin-density-wave state in
La$_4$Ni$_3$O$_{10}$ with an in-plane ($\pi$, $\pi$) order and
antiferromagnetic coupling between the top and bottom Ni layers, while the
middle layer has spin zero.
