The algebraic set $V$ is connected if and only if the coordinate ring $k[V]$ is not the direct sum of two nonzero ideals. Let $V$ be an affine algebraic set in $\Bbb{A}^n$.  Then $V$ is connected in the Zariski topology on $V$ if and only if $k[V] = k[\Bbb{A}^n]/I(V)$ is not the direct some of two ideals.  I'm stuck trying to prove the $\Rightarrow$ direction.  By direct sum I assume they mean usual direct sum thinking of ideals as submodules, so I need to prove that $k[\Bbb{A}^n]/I(V) \neq J/I(V) \oplus K/I(V)$ for any two ideals $J,K$ in $k[\Bbb{A}^n]$ properly containing $I(V)$.  Unsure how to proceed.
 A: Assume $k[V]=J/I\oplus K/I$ where $I=I(V)$.
Then there are $f\in J$ and $g \in K$ such that 
$$1+I=(f+I)+(g+I)$$ or in other words 
$$1=f(x)+g(x)$$ for $x\in V$.
Further $J\cap K \subseteq I$ since the sum is direct. And so $fg \in  J\cap K \subseteq I$ and thus 
$$f(x)g(x)=0$$ for $x\in V$.
Now we show the open sets 
$$D(f)=\{x | f(x) \neq 0\}$$ and 
$$D(g)=\{x | g(x) \neq 0\}$$ disconnect $V$.
$$D(f)\cap D(g)\cap V= D(fg)\cap V =\emptyset$$
To see $V \subseteq D(f)\cup D(g)$ let $x\in V$ then $f(x)+g(x)=1$ so either $f(x)\neq 0$ or $g(x)\neq 0$.
A: Although it is an old question, I would like to point out that the question is not correct. It requires the field $k$ to be algebraically closed. Here is the proof of => part:
Assume $k[V] = J/\mathcal{I}(V)\oplus K /\mathcal{I}(V)$, where $\mathcal{I}(V)$ is defined as maximal ideal in $k[A^n]$ such that all element of it vanishes on algebraic set $V$. Also $J$ and $K$ are two ideals in $k[A^n]$. Therefore, due to direct summation, we have $J \cap I = \mathcal{I}(V)$. Then $\mathcal{Z}(J \cap I) = \mathcal{Z}(J) \cup \mathcal{Z}(K) = \mathcal{Z}(\mathcal{I}(V))=V$, where $\mathcal{Z}(C)$ denotes the common zeros of polynomial in set $C$. Since $J/\mathcal{I}(V)$ and $K/\mathcal{I}(V)$ are both nonzero, $\mathcal{Z}(J)$ and $\mathcal{Z}(K)$ are not empty. Thus, it contradicts the hypothesis that $V$ is connected.
For the <= part (assume that $k$ is algebraically closed):
Suppose that $V = V_1 \cup V_2$ with $V_1 \cap V_2= \phi$ ($V_i$, $i=1,2$, is not empty). Since $k$ is algebraically closed, $V_i = \mathcal{Z}(I_i)$, $i=1,2$, for some radical ideal in $k[x_1, \cdots, x_n]$ by Hilbert's Nullstellensatz. Thus $V = \mathcal{Z}(I_1 \cap I_2)$. Thus $\mathcal{I}(V) =I_1 \cap I_2$. Furthermore, $V_1 \cap V_2 = \phi$ implies that $\mathcal{Z}(I_1 + I_2) = \phi$. By Nulsterlensatz again, we have $I_1 + I_2 = k[A^n]$. Now, applying Chinese Remainder Theorem, we have $k[V] = I_1/\mathcal{I}(V)\oplus I_2/\mathcal{I}(V)$. It reaches a contradiction.
The counterexample for <= part. Let $\mathbb{R}$ be a real set. Consider $\mathbb{R}[A^2]$. Let $V_1 = \mathcal{Z}(x^2+y)$ and $V_2=\mathcal{Z}(y-1)$. Then $V_1 \cap V_2 = \phi$. So $V=V_1 \cup V_2$ is not connected. $\mathcal{I}(V) = ((x^2+y)(y-1))$. Then $\mathbb{R}[V]$ can't be written as a direct sum. To see this, if the direct sum exists, it must have a non-trivial idempotent element in $\mathbb{R}[V]$. But it is easy to see such an idempotent doesn't exist.
