When you ask "do protons and neutrons retain their identity in nuclei" and fail to mention isospin, there is clearly a misunderstanding.
So, a simpler question: Do electrons in a neutral helium atom maintain their spin alignment? Where the electrons are added to the $S$ shell one by one, first spin down, and then spin up to complete the shell without violating Pauli's exclusion principle.
Well that is wrong. The electrons fill the shell with a totally antisymmetric wave function, and all the antisymmetry is in the spins:
$$ \chi = \frac{|\uparrow\rangle|\downarrow\rangle-|\downarrow\rangle|\uparrow\rangle}{\sqrt 2} =|S=0, S_z=0\rangle$$
Each electron is in an indefinite state of $s_z$, but the total state is an eigenvalue of $\hat S^2$ and $\hat S_z$.
Isospin is called isospin ($\vec I$) because it replaces spin ($\vec S$) up/down with the exact mathematical formalism of spin, except with proton/neutron being eigenstates of $\hat I_3$.
So what's a deuteron? It's mostly $S$-wave (with some $D$-wave)...so it's even in spatial coordinates. The spin is one, so it's even in spin. That mean the antisymmetry falls on isospin, where it's clearly $I_3=0$. To be antisymmetric, it must be $I=0$, too:
$$|I=0, I_3=0\rangle = \frac{|p\rangle|n\rangle-|n\rangle|p\rangle}{\sqrt 2}$$
Since the 1st (2nd) bra refers to particle one (two), it is clear that individual nucleons are not in definite states of $I_3$ in a deuteron. In other words, they're 1/2 proton and 1/2 neutron, just as two electron spins aren't definite in the $S_z=0$ states.
There's no need to reference quarks to resolve this, as:
$$ p \rightarrow \pi^+ + n \rightarrow p $$
$$ n \rightarrow \pi^- + p \rightarrow n $$
is perfectly fine (where the intermediate state is a virtual pion binding stuff).
Since a helium atom was mentioned, a good exercise is to workout the spatial, spin, and isospin wave functions: it is very spherical in real space and iso-space...which is why it is so stable.
Best Answer
Yes, here is a little more detail:
Within the nucleus, there exists a shell structure to the protons and neutrons inhabiting it, similar to the shell structure of the electron orbitals outside the nucleus. Those different shells contain nucleons with different energies. At the same time, there is a natural tendency for those protons and neutrons to in some sense "agglomerate" into alpha particle associations, because of the extremely high binding energy of such clumps.
But it isn't geometrically possible for protons and neutrons to 1) pack themselves down perfectly into a hexagonal-close-packed ("fully dense") form, 2) maintain the alpha particle associations, and 3) obey the shell structure rules as you add more and more nucleons to the nucleus. Compromises are necessary; this means that there will be certain nuclei in the periodic table that are lucky and have high binding energies and others that are less tightly-bound, and still others which are so unstable that they decay quickly and are not found in nature.
In a practical sense, this means you can model alpha decay as a highly asymmetrical case of fission, which one of the fission products is an intact alpha particle i.e., a helium nucleus.
This also means that there are nucleon configurations (or packing schemes) which are energetically unfavored but which can be created through collisions with other particles, yielding something called a shape isomer which you can think of as a metastable nucleus with a lump sticking out of one side or having a football-like shape instead of being spherical. The shape isomer can have a half-life for decay of microseconds, seconds, minutes, hours, days or years, and can produce (for example) a highly-energetic gamma ray when it decays.
A certain isotope of technetium, for example, can be produced in an accelerator to yield a shape isomer with a decay half-live of order ~6 hours and which produces highly penetrating 140 kiloelectron-volt gamma rays. These are routinely prepared and used as tracer elements in various medical procedures.