Let $(X,\mathcal{T})$ be a compact topological space, let $A \subseteq X$ be a closed subset of $X$, equipped with the subspace topology.
Prove that $A$ is compact w.r.t. the subspace topology.
I'm not interested in alternative proofs. Just want to verify whether my attempt is correct:
My attempt:
Let $\mathcal{U}$ be an ultrafilter in $A$. Consider the canonical injection $f: A \to X: a \mapsto a$. It follows that $\mathcal{U} = f( \mathcal{U})$ is a filterbasis of $X$. Hence, $\operatorname{stack(\mathcal{U}})$ is a filter on $X$, which by compactness has a limit, say $x$.
Because $A \in \mathcal{U} \subseteq \operatorname{stack}(\mathcal{U}) \to x$, it follows that $x \in \operatorname{cl}_X(A) = A$.
We now prove that $\mathcal{U} \to x \in A$ in $(A,\mathcal{T}_A)$
So, let $V$ be a neighborhood of $x$ in $A$. Then, there is a neighborhood $D$ of $x$ in $X$ such that $V = A \cap D$. But $\operatorname{stack}\mathcal{U} \to x$, so there exists $B \in \mathcal{U}$ s.t. $D \supseteq B$.
Then, $B = B \cap A \subseteq D \cap A = V$, and because $V \in 2^A$, and because $\mathcal{U}$ is a filter, it follows that $V \in \mathcal{U}$. Hence, every neighborhood of $x$ in $A$ is contained in the ultrafilter $\mathcal{U}$, so that $\mathcal{U} \to x$. This ends the proof.
Is this correct?
Your proof is correct. One could shorten it a bit, noting that by definition of the subspace topology one has $\mathcal{U} \to x$ if and only if $f_{\ast}(\mathcal{U})$ (the image filter of $\mathcal{U}$ under the inclusion $F \colon A \hookrightarrow X$) converges to $x$, but spelling out the details of this is not a bad idea.