An easier way for the first case
Consider $P$, a $3$-Sylow subgroup of $A_4$. For example, take the cyclic group generated by the cyclic permutation (123). It is self normalizing, so the double coset formula for the compositions $BP\rightarrow BA_4 \stackrel{tr}{\rightarrow}BP$ where $tr$ denotes the transfer, reduces to the identity. Therefore $BP$ and $BA_4$ are homotopy equivalent at the prime 3.
For the second case, let's start with the review of the well-known computation of
$H^*(B\Sigma _p;Z/p)$. Again as in the above, denote by $P$ the cyclic group generated by the cyclic permutation $(12\cdots p)$. Denote by $N$ the group of affine automorphisms of $Z/p$, considered as a subgroup of the permutation of $\{1,\ldots ,p\}$. Then $N$ is the normalizer of $P$ in $\Sigma _p$,
with $N/P\cong Gl_1(Z/p)$ with the canonical action on $Z/p$. Now the double coset formula for the compositions $BP\stackrel{Bi}{\rightarrow} B\Sigma _p \stackrel{tr}{\rightarrow}BP$ says that in mod $p$ cohomology, this composition is the sum
of maps induced by the multiplication by $s\in Gl_1(Z/p)$. In other words,
we have, $$Bi^*tr^*(\beta ^{\epsilon}x^i)=\Sigma _{s\in Gl_1(Z/p)}\beta ^{\epsilon}s^ix^i\in H^*(BZ/p,Z/p)\cong Z/p[x]\otimes \Lambda _{Z/p}(\beta x).$$
The little Theorem of Fermat then shows that this is identity if $p-1\mid i$, $0$ otherwise. Therefore we get
$$H^*(B\Sigma _p,Z/p)\cong Z/p[x^{p-1}]\otimes \Lambda _{Z/p}(\beta x^{p-1})\subset
H^*(BZ/p,Z/p).$$
Now, if we replace $\Sigma _p$ with $A_{p+1}$, what changes is the normalizer.
It is easy to see that $$N_{A_{p+1}}(P)=A_{p+1}\cap \Sigma _p.$$ We also see that the generator of $Gl_1(Z/p)$ acts on $P$ as a cyclic permutation of length $p-1$, thus its an odd permutation. This means in the appropriate double coset formula, the only half of $s's$ get involved (squares in $Gl_1(Z/p)$), and we arrive at the conclusion $$H^*(BA _{p+1},Z/p)\cong Z/p[x^\frac{p-1}{2}]\otimes \Lambda _{Z/p}(\beta x^\frac{p-1}{2})\subset
H^*(BZ/p,Z/p).$$ When $p=3$, this reduces to the first case treated in the above.