$(X, \mathscr T )$ be a topological space and $A \subset X$. $\{ U_i \mid i \in I \}$ is said to be an open cover of $A$ if $A \subset \cup_{i \in I} U_i$. $A$ is said to be compact if there exists finite $J \subset I$ such that $A \subset \cup_{i \in J} U_i$. $\{ U_i \mid i \in J \}$ is then called finite subcover of $A$.
My doubt:
Let set of open sets which cover $A \subset X$ be $\{U_1,U_2, U_3, \dots\}$. If we add $X$ in this collection of open sets, then also it would cover $A$ i.e. the new covering set be $\{X, U_1,U_2, U_3, \dots\}$. Now we need to take a finite subset of the above "covering set". Let that subset be $\{X, \phi \} $ i.e $\{X, \phi \} \subset \{X, U_1,U_2, U_3, \dots\}$. This subset would cover $A$ since $A \subset X$. So $A$ is compact. But we can virtually do this with any subset of $X$. I know this is wrong but where am I making a mistake?
I think the problem in understanding this is that you have combined several definitions into one statement, and the other definitions obscure the one you should focus on. You should separate the definitions so they aren't so intertwined. For example:
(1) Definition of cover: Let $X$ be a set. A cover of $X$ is a set $\mathscr A \subset \mathscr P(X)$ such that $\bigcup\mathscr A = X$.
(2) Definition of open cover: Let $(X,\mathscr T)$ be a topological space. An open cover of $X$ is a cover $\mathscr A$ of $X$ such that $\mathscr A \subset \mathscr T$.
(3) Definition of subcover: Let $\mathscr A$ be a cover of a set $X$. A (finite) subcover is a (finite) set $\mathscr B \subset \mathscr A$ which is also a cover of $X$.
(4) Definition of compactness: Let $(X,\mathscr T)$ be a topological space. $X$ is compact if every open cover $\mathscr A$ of $X$ contains a finite subcover of $X$.
I point out that in all of this, the qualifying phrase "of $X$" is frequently omitted if it is clear from context.