TITLE: Is every connected scheme path connected?
QUESTION [40 upvotes]: Every (?) algebraic geometer knows that concepts like homotopy groups or singular homology groups are irrelevant for schemes in their Zariski topology. Yet, I am curious about the following.
Let's start small. Consider a local ring $A$ with maximal ideal $M$; is the affine scheme $X=Spec(A)$  connected? Sure, because every open subset of $X$ containing $M$ is equal to $X$ itself. Or because the only idempotents of $A$ are $0$ and $1$. But is it path connected? Yes, because if you take any point $P$ in $X$ the following path $\gamma$  joins it to $M$ (reminds you of the hare and the tortoise...):
$ \gamma(t)=P \quad  for \quad  0\leq t < 1\quad , \quad \gamma (1)=M $.
The same trick shows that the spectrum of an integral domain is path connected: join the generic point to any prime by a path like above. More generally, in the spectrum of an arbitrary ring $R$ you can join a prime $P$ to any bigger prime $Q$   $(P \subset Q)$ by adapting the formula above:
$ \gamma(t)=P \quad  for \quad  0\leq t < 1\quad , \quad \gamma (1)=Q $.
[Continuity at $t=1$ follows from the fact that every neighbourhood of $Q$ contains $P$ and so its  inverse image under $\gamma$ is all of $[0,1]$ ]
The question in the title just asks more generally:
Is a connected scheme path connected ?
Edit (after reading the comments) If an arbitrary topological space is connected and if every point has at least one path connected open neighbourhood, then the space is path connected. But I don't see why the local condition holds in a scheme, affine or not, even after taking into account what I proved about local rings.

REPLY [25 votes]: There exist connected affine schemes which are not path connected. Let E be a compact connected metric space* which is not path connected (e.g., the closed topologist's sine curve) and consider the following.

$X={\rm Spec}(A)$ where $A$ is the ring of continuous functions $f\colon E\to\mathbb{R}$.

Then X is connected, since any idempotent f satisfies $f(x)\in\{0,1\}$ and, by connectedness of E, $f=0$ or $f=1$. The maximal ideals of A are
$$
\mathcal{m}_x=\left\{f\in A\colon f(x)=0\right\}
$$
for $x\in E$. There will also non-maximal primes (see this question for example) but, every prime ideal will be contained in one and only one of the maximal ideals**. So, we can define $\pi\colon X\to E$ by $\pi(\mathcal{p})=x$ for prime ideals $\mathcal{p}\subseteq\mathcal{m}_x$.
In fact, $\pi$ is continuous, using the following argument. For any open ball $B_r(x)$ in E, choose $f\in A$ to be positive on $B_r(x)$ and zero elsewhere. Then $D_f=\left\{\mathcal{p}\in X\colon f\not\in \mathcal{p}\right\}$ is open and $\pi^{-1}(B_r(x))\subseteq D_f\subseteq \pi^{-1}(\bar B_r(x))$.
Writing $B_r(x)=\cup_{s < r}B_s(x)=\cup_{s < r}\bar B_s(x)$, this shows that there are open sets $U_s$ lying between $\pi^{-1}(B_s(x))$ and $\pi^{-1}(\bar B_s(x))$. So, $\pi^{-1}(B_r(x))=\bigcup_{s < r} U_s$ is open, and $\pi$ is continuous.
So, $\pi\colon X\to E$ is continuous and onto. If X was path connected then E would be too.
It may be worth noting that ${\rm Specm}(A)$ is also connected but not path connected, being homeomorphic to E.

(*) I assume that E is a metric space in this argument so that the open balls give a basis for the topology, and there are continuous $f\colon E\to\mathbb{R}$ which are nonzero precisely on any given open ball. Actually, it is enough for the topology to be generated by the continuous real-valued functions. So the argument generalizes to any compact Hausdorff space (+ connected and not path connected, of course).
(**) Maybe I should give a proof of the fact that every prime $\mathcal{p}$ is contained in precisely one of the maximal ideals $\mathcal{m}_x$. Let $V(f)=\{x\in E\colon f(x)=0\}$ be the zero set of f. Then, $V(\mathcal{p})\equiv\bigcap\{V(f)\colon f\in\mathcal{p}\}$ will be non-empty. Otherwise, by compactness, there will be $f_1,f_2,\ldots,f_n\in\mathcal{p}$ with $V(f_1)\cap V(f_2)\cap\cdots\cap V(f_n)=\emptyset$. Then, $f=f_1^2+f_2^2+\cdots+f_n^2\in\mathcal{p}$ would be nonzero everywhere, so a unit, contradicting the condition that $\mathcal{p}$ is a proper ideal. Choosing $x\in V(\mathcal{p})$ gives $\mathcal{p}\subseteq\mathcal{m}_x$.
On the other hand, we cannot have $\mathcal{p}\subseteq\mathcal{m}_x\cap\mathcal{m}_y$ for $x\not=y$. Letting $f,g\in X$ have disjoint supports with $f(x)\not=0, g(y)\not=0$ gives $fg=0\in\mathcal{p}$ and, as $\mathcal{p}$ is prime, $f\in\mathcal{p}\setminus\mathcal{m}_x$ or $g\in\mathcal{p}\setminus\mathcal{m}_y$.