  We study the system of semilinear elliptic equations $$-\Delta u_i+ u_i =
\sum_{j=1}^\ell \beta_{ij}|u_j|^p|u_i|^{p-2}u_i, \qquad u_i\in
H^1(\mathbb{R}^N),\qquad i=1,\ldots,\ell,$$ where $N\geq 4$,
$1<p<\frac{N}{N-2}$, and the matrix $(\beta_{ij})$ is symmetric and admits a
block decomposition such that the entries within each block are positive or
zero and all other entries are negative.
  We provide simple conditions on $(\beta_{ij})$, which guarantee the existence
of fully nontrivial solutions, i.e., solutions all of whose components are
nontrivial.
  We establish existence of fully nontrivial solutions to the system having a
prescribed combination of positive and nonradial sign-changing components, and
we give an upper bound for their energy when the system has at most two blocks.
  We derive the existence of solutions with positive and nonradial
sign-changing components to the system of singularly perturbed elliptic
equations $$-\varepsilon^2\Delta u_i+ u_i = \sum_{j=1}^\ell
\beta_{ij}|u_j|^p|u_i|^{p-2}u_i, \qquad u_i\in H^1_0(B_1(0)),\qquad
i=1,\ldots,\ell,$$ in the unit ball, exhibiting two different kinds of
asymptotic behavior: solutions whose components decouple as $\varepsilon\to 0$,
and solutions whose components remain coupled all the way up to their limit.
