Consider the scheme $X:=\mathrm{Spec}(k[X,Y]/(X^2,XY))$. According to Qing Liu's "Algebraic geometry and arithmetic curves", the irreducible components are in $1-1$ correspondence with subschemes of the form $V(\mathcal{P})$ where $\mathcal{P}$ is a minimal prime ideal of $k[X,Y]/(X^2,XY)$. If I understand correctly, this means $X$ has exactly one irreducible component, in particular the subscheme $V(X)$ (as every prime contains the ideal generated by $X$). Is this correct?
[Math] Irreducible components of schemes
algebraic-geometrycommutative-algebra
Related Solutions
$(0)$ is not always in $\operatorname {Spec} A$ is where your reasoning went wrong. One can show rather straightforwardly that $\operatorname {Spec} A$ is irreducible iff the the nilradical is prime (Exercise 19 in Ch. 1 of Atiyah and Macdonald's commutative algebra book) Note there is a natural homeomorphism induced by the projection map between $\operatorname {Spec} A/I$ and the closed subset of $\operatorname {Spec} A$, $V(I)= \{p\in \operatorname {Spec} A\ | \ I\subseteq p\}$, so this deals with the irreducible components question as well.
Just friendly advice, I would recommend you do most of the exercises in a book like Atiyah and Macdonald before seriously attempting to learn about schemes.
First, you should convince yourself that the question whether a given morphism $\operatorname{Spec} \mathcal{O}_{X,x} \to Y$ extends to an open neighborhood of $x$ comes down to the following question in commutative algebra:
Let $A$ and $B$ be two rings and let $\mathfrak{p}$ be a prime ideal of $A$. Does a given ring homomorphism $B \to A_\mathfrak{p}$ factor as $B \to A_f \to A_\mathfrak{p}$ for some $f \in A \setminus \mathfrak{p}$?
Note that there is no reason to hope that such a factorization always exists. Indeed, the answer to the above question might be "no".
But what if $B$ is a finitely generated $R$-algebra with $R$ a Noetherian ring, $A$ is an $R$-algebra and the given morphism is a morphism of $R$-algebras? This is the case you have to deal with in solving your exercise (I'll assume you are able to work out why - if you have trouble, just drop a comment). Then the above question is guaranteed to have a positive answer. Let's prove this. Write $B = R[T_1,\dotsc,T_n] / (g_1,\dotsc,g_m)$, denote the composite of the canonical projection $R[T_1,\dotsc,T_n] \twoheadrightarrow B$ with the given morphism $B \to A_\mathfrak{p}$ by $\varphi$ and write
$$\varphi(T_i) = \frac{a_i}{f_i}, \quad i=1,\dotsc,n \, ,$$ $$\varphi(g_j) = \frac{a_j'}{h_j}, \quad j=1,\dotsc,m \, .$$
Now, for each $j \in \lbrace 1,\dotsc,m \rbrace$, choose some $f_j' \in A \setminus \mathfrak{p}$ such that $f_j' a_j' = 0$ in $A$ (which exists since $\varphi(g_j) = 0 \in A_\mathfrak{p}$). I now claim that $f = \prod_{i=1}^n f_i \prod_{j=1}^m f_j'$ has the desired property, i.e. that the given homomorphism factors through $A_f \to A_\mathfrak{p}$. To see why, we first make use of the fact that, by construction, $f$ is a common denominator of all the $\varphi(T_i)$ and note that
$$ T_i \mapsto \frac{a_i \prod_{k \neq i} f_k \prod_{j=1}^m f_j'}{f}, \quad i=1,\dotsc,n$$
defines a morphism of $R$-algebras $R[T_1,\dotsc,T_n] \to A_f$ whose composite with $A_f \to A_\mathfrak{p}$ agrees with $\varphi$. In addition, we have, by construction, $a_j' f = 0$ for all $j \in \lbrace 1,\dotsc,m \rbrace$; thus, the morphism just defined maps each $g_j$ to $0$ and, as a consequence, factors over $B$.
Best Answer
Yes, your scheme $X$ has exactly one irreducible component - i.e., it is an irreducible scheme. Note that an affine scheme $\operatorname{Spec} R$ is irreducible if and only if the nilradical of $R$ is prime. Here, the nilradical of $k[X,Y]/(X^2,XY)$ is $(\overline{X})$ (where $\overline{X}$ denotes the image of $X$ in $k[X,Y]/(X^2,XY)$) and this is a prime ideal since $(k[X,Y]/(X^2,XY))/(\overline{X}) \cong k[Y]$. However, you should be careful to understand your claim that "the subscheme $V(X)$" is the irreducible component of $X$ correctly.
Let me explain. There is a natural way to view $X$ as a closed subscheme of $\mathbb{A}_k^2 = \operatorname{Spec} k[X,Y]$. The underlying set of this subscheme contains precisely those prime ideals $\mathfrak{p}$ of $k[X,Y]$ such that $\mathfrak{p} \supset (X^2,XY)$. As A.P.'s comment to your question shows, we have $$ \mathfrak{p} \supset (X^2,XY) \Leftrightarrow \mathfrak{p} \supset (X) .$$ It is customary to express this by writing $$ V(X) = V(X^2,XY), $$ which is perfectly fine as long as you understand this as an equality of sets only (of course, the subspace topology induced by the Zariski topology on $\mathbb{A}_k^2$ then agrees as well, which is why you could also view the above equality as an equality of topological spaces).
However, sometimes $V(X)$ is not used to denote a subset, but to denote a subscheme (and writing "the subscheme $V(X)$" suggests just that) - here, that would be the scheme $\operatorname{Spec} k[X,Y]/(X)$. But $\operatorname{Spec} k[X,Y]/(X^2,XY)$ and $\operatorname{Spec} k[X,Y]/(X)$ are not isomorphic as schemes. In fact, there is a bijective correspondence between the closed subschemes of any affine scheme $\operatorname{Spec} R$ and the ideals of $R$ - but clearly, $(X^2, XY) \neq (X)$.
(Well, $\operatorname{Spec} k[X,Y]/(X)$ is [naturally isomorphic to] a closed subscheme of $\operatorname{Spec} k[X,Y]/(X^2,XY)$ and, strictly speaking, it is true that $\operatorname{Spec} k[X,Y]/(X)$ is the irreducible component of $\operatorname{Spec} k[X,Y]/(X^2,XY)$ because the underlying topological spaces of those two schemes agree. But, at least to me, this seems to be a rather strange way of asserting that $\operatorname{Spec} k[X,Y]/(X^2,XY)$ is irreducible.)
--
I now feel a bit silly for writing this pedantic and probably superfluous remark so let me add another comment which might be of more interest to you: While the scheme $X$ is irreducible, it has an embedded prime. For this reason, it might help you to understand the "geometric meaning" of associated primes and primary decompositions - in particular, in what sense they yield more refined information than the decomposition into irreducible components.