[proofplan]
We prove both implications by translating covers through the [subspace topology](/page/Subspace%20Topology). An ambient [open cover](/page/Open%20Cover) $(U_i)_{i \in I}$ of $X$ becomes the subspace-open cover $(X \cap U_i)_{i \in I}$ of $X$, so compactness of $(X,\tau_X)$ gives finitely many ambient sets covering $X$. Conversely, any open cover of $(X,\tau_X)$ can be represented by intersections $X \cap U_i$ with ambient open sets $U_i \in \tau$; the assumed ambient finite-subcover property then gives a [finite subcover](/page/Finite%20Subcover) in the subspace topology.
[/proofplan]
[step:Intersect an ambient open cover with $X$ and use compactness]
Assume that $(X,\tau_X)$ is compact. Let $I$ be an index set, and let $(U_i)_{i \in I}$ be a family of subsets of $Y$ such that $U_i \in \tau$ for every $i \in I$ and
\begin{align*}
X \subset \bigcup_{i \in I} U_i.
\end{align*}
For each $i \in I$, define
\begin{align*}
V_i := X \cap U_i.
\end{align*}
By the definition of the subspace topology, $V_i \in \tau_X$ for every $i \in I$. Also,
\begin{align*}
X = \bigcup_{i \in I} V_i.
\end{align*}
Indeed, if $x \in X$, then the ambient cover assumption gives some $i \in I$ with $x \in U_i$, hence $x \in X \cap U_i = V_i$.
Thus $(V_i)_{i \in I}$ is an open cover of $(X,\tau_X)$. Since $(X,\tau_X)$ is compact, there exists a finite subset $J \subset I$ such that
\begin{align*}
X = \bigcup_{i \in J} V_i.
\end{align*}
For every $i \in J$, we have $V_i = X \cap U_i \subset U_i$, and therefore
\begin{align*}
X \subset \bigcup_{i \in J} U_i.
\end{align*}
This proves the ambient open-cover property.
[guided]
Assume that $(X,\tau_X)$ is compact. We must prove the ambient open-cover property, so let $I$ be an arbitrary index set and let $(U_i)_{i \in I}$ be an arbitrary family of open subsets of $Y$ satisfying
\begin{align*}
X \subset \bigcup_{i \in I} U_i.
\end{align*}
The compactness hypothesis applies to open covers of $X$ in the topology $\tau_X$, not directly to open subsets of $Y$. Therefore we convert each ambient [open set](/page/Open%20Set) into a subspace-open set. For each $i \in I$, define
\begin{align*}
V_i := X \cap U_i.
\end{align*}
Since $U_i \in \tau$, the definition of the subspace topology gives $V_i \in \tau_X$.
We now check that these $V_i$ cover $X$. Let $x \in X$. Since $X \subset \bigcup_{i \in I} U_i$, there exists some $i \in I$ such that $x \in U_i$. Because also $x \in X$, we have $x \in X \cap U_i = V_i$. Hence every point of $X$ lies in at least one $V_i$, so
\begin{align*}
X = \bigcup_{i \in I} V_i.
\end{align*}
Thus $(V_i)_{i \in I}$ is an open cover of $(X,\tau_X)$.
By compactness of $(X,\tau_X)$, this open cover has a finite subcover. Therefore there exists a finite subset $J \subset I$ such that
\begin{align*}
X = \bigcup_{i \in J} V_i.
\end{align*}
Finally, for each $i \in J$, the inclusion $V_i = X \cap U_i \subset U_i$ holds by the definition of intersection. Taking the union over the finite set $J$ gives
\begin{align*}
X \subset \bigcup_{i \in J} U_i.
\end{align*}
This is exactly the required finite ambient subcover.
[/guided]
[/step]
[step:Represent a subspace open cover by ambient open sets]
Assume the ambient open-cover property. Let $I$ be an index set, and let $(V_i)_{i \in I}$ be an open cover of $(X,\tau_X)$. Thus $V_i \in \tau_X$ for every $i \in I$ and
\begin{align*}
X = \bigcup_{i \in I} V_i.
\end{align*}
By the definition of $\tau_X$, for each $i \in I$ there exists $U_i \in \tau$ such that
\begin{align*}
V_i = X \cap U_i.
\end{align*}
Then
\begin{align*}
X = \bigcup_{i \in I} V_i \subset \bigcup_{i \in I} U_i.
\end{align*}
The ambient open-cover property gives a finite subset $J \subset I$ such that
\begin{align*}
X \subset \bigcup_{i \in J} U_i.
\end{align*}
We prove that $(V_i)_{i \in J}$ covers $X$. Let $x \in X$. Since $x \in \bigcup_{i \in J} U_i$, there is some $i \in J$ with $x \in U_i$. Since $x \in X$, it follows that
\begin{align*}
x \in X \cap U_i = V_i.
\end{align*}
Hence
\begin{align*}
X \subset \bigcup_{i \in J} V_i.
\end{align*}
The reverse inclusion $\bigcup_{i \in J} V_i \subset X$ holds because each $V_i \subset X$. Therefore
\begin{align*}
X = \bigcup_{i \in J} V_i.
\end{align*}
So every open cover of $(X,\tau_X)$ has a finite subcover, and hence $(X,\tau_X)$ is compact.
[/step]