I am trying to prove that the intersection of maximal subgroups of a finite group lies in a maximal subgroup of that group.
My question: Can someone please verify my proof below? I am afraid that the two statements in blue are contradictory. Is it really the case?
Proof: Let $G$ be finite. Suppose $K \leq G$ and $[G:K]$ is prime. Then, \begin{equation}\label{amend} [G:K] = \frac{\left|G\right|}{\left|K\right|} = p \end{equation} where $p$ is a prime. Then, $\left|G\right| > \left|K\right|$, implying that $K$ is a proper subgroup of $G$. $\color{blue}{\textrm{Then, $K$ must be contained in some maximal subgroup of $G$}}$ by the hint; denote such a maximal subgroup of $G$ containing $K$ by $V$. Clearly, $K \leq V$. which implies $K \leq V \leq G$ and \begin{equation*} [G:K] = [G:V] [V:K] = p \end{equation*} Since $p$ is prime, either $[G:V] = 1 \implies \left|G\right| = \left|V\right| \left( \textrm{and } [V:K] = p\right)$ or $\left([G:V] = p \textrm{ and}\right) [V:K] = 1 \implies \left|V\right| = \left|K\right|$. Thus, either $\left|G\right| = \left|V\right|$ or $\left|V\right| = \left|K\right|$ which shows that $\color{blue}{\textrm{$K$ is a maximal subgroup of $G$}}$. Then, clearly, $M(G) \subseteq K$.
This is correct. However, you're given that $G$ is finite, so you don't need to check that every subgroup and index is finite along the way. Since $K$ is a subgroup of $G$, you do not need to check that it is a subgroup of $V$. Given that $K$ is a subgroup of $V$ and $V$ is a subgroup of $G$, and $K$ is of prime index, you correctly deduced that $V=K$, i.e. $K$ is maximal. This does not contradict the fact that $K$ is contained in a maximal subgroup; it is contained in itself, though not properly, which is fine.