I'm trying to prove it using the following definition:
X is called compact if each of its open covers has a finite subcover.
I've tried the following
Assume that {p} is compact (Here is the problem, I don't know how to explain it formally.)
So {p} has a finite subcover $\bigcup_{i=1}^n Z_i$ and let $\bigcup_{i=1}^n V_i$ a finite subcover of K.
Then
$$\bigcup_{i=1}^n Z_i \times \bigcup_{i=1}^n V_i = \bigcup_{i=1}^n U_i \times V_i $$
It's a finite subcover of $ \{p\} \times K$.
Also I'd like to know, Can I choose the finite number of subcovers of compact sets?
Because I chose the same number of subcover for {p} and K, and I don't know if it's right.
Thank you for your attention.
Singletons $\{p\}$ are compact because if $\bigcup_{i\in I}U_i\ni p$ is a cover by open sets, then there is some $i_0i\in I$ such that $U_{i_0}\ni p$. then $\bigcup_{i\in\{i_0\}}U_i\ni p$ is a finite sub-cover; it has only one open set.
Assume that $f:\mathbb{R}^n\to \mathbb{R}^n\times\mathbb{R}^m$ is the embedding $f(x)=(x,p)$, which is continuous. Let $$\bigcup_{i\in I}U_i\supset K\times \{p\}$$ be an open cover.
Then $\bigcup_{i\in I}f^{-1}(U_i)\supset K$ is an open cover of $K$. Therefore there is a finite subset $J\subset I$ such that $\bigcup_{i\in J}f^{-1}(U_i)\supset K$. Hence $\bigcup_{i\in J}U_i\supset K\times \{p\}$ is a finite cover of $K\times\{p\}$.