TITLE: When is $max Spec R$ homotopy equivalent with $Spec R$ (with Zariski topology)?
QUESTION [9 upvotes]: A commutative ring with unity is called pm-ring if every prime ideal is contained in a unique maximal ideal. In [dMO71], it is shown that  pm-rings are characterized by the fact that $\operatorname{max Spec} R$ (the set of all maximal ideals under Zariski subspace topology) is a retract of $\operatorname{Spec} R$, and in this case, the unique retraction is given by $u: \operatorname{Spec} R \to \operatorname{max Spec} R$ , $u(P)$ is the unique maximal ideal containing $P\in \operatorname{Spec} R$ . 
It can moreover be shown that for pm-rings, this retract is actually also a deformation retract , because  $H : \operatorname{Spec} R \times [0,1] \to \operatorname{Spec} R$ given by $H(P,t)=P, \forall t \in [0,1)$ and $H(P,1)=u(P)$ is continuous, so gives a homotopy between $i\circ u$ and $Id_{\operatorname{Spec} R}$, where $i:\operatorname{max Spec} R \to \operatorname{Spec} R$
 is the inclusion map. 
So the questions I want to ask are the following : 
(1) Can we characterize (possibly algebraic characterization) commutative rings (with unity) $R$ such that $\operatorname{max Spec} R$ is homotopy equivalent with $\operatorname{Spec} R$ ?
(2) Can we characterize commutative rings (with unity) $R$, such that $i : \operatorname {max} \operatorname {Spec} R \to \operatorname {Spec} R$ is a homotopy equivalence i.e. there exists a map $g : \operatorname {Spec} R \to \operatorname {max} \operatorname {Spec} R$ such that $i\circ g$ and $g \circ i$ are homotopic to the respective identity maps ? 
As noted, pm-rings are definitely in both the class, but what are all such rings ? Even if we can't say what are all such rings, can we atleast find class  of rings for each case (1) and (2) which are not necessarily pm-rings ? 

References.
[dMO71] De Marco, Giuseppe; Orsatti, Adalberto, Commutative rings in which every prime ideal is contained in a unique maximal ideal, Proc. Am. Math. Soc. 30, 459-466 (1971). ZBL0207.05001.

REPLY [2 votes]: This is not a full answer, but some examples to show that the situation is a bit tricky. (This answer was worked out together with Dmitrii Pirozhkov.)
Lemma. Let $R$ be a domain. Then $X = \operatorname{Spec} R$ is contractible.
Proof. In fact, the inclusion of the generic point $\eta$ is a deformation retract, by the map
\begin{align*}
[0,1] \times X &\to X \\
(t,\mathfrak p) &\mapsto \left\{\begin{array}{ll}\mathfrak p, & t = 0, \\ \eta, & t > 0.\end{array}\right.
\end{align*}
(One easily shows that this map is continuous.) $\square$
Thus, for a domain, the question is when $\operatorname{Specmax} R$ is contractible. Even for simple examples like $R = k[t]$, the result depends on the base field $k$:
Example. Let $R$ be a $1$-dimensional Noetherian domain. Then $X = \operatorname{Specmax} R$ is a cofinite topological space. But the homotopy type depends on the cardinality of $X$:

If $|X| = 1$, then $R$ is local and $X$ is evidently contractible (since it is a point).
If $X$ is countable but has more than $1$ element, then $X$ is not path connected (see e.g. this MO post), so in particular it is not contractible.
If $|X| \geq |\mathbb R|$, then we can choose a bijection $\phi \colon (0,1) \times X \to X$. Extend $\phi$ to a map $\phi \colon [0,1] \times X \to X$ by setting $\phi(0,-) = \operatorname{id}$ and $\phi(1,-) = \mathfrak m_0$ a constant map. Then each fibre of $\phi$ is closed, hence $\phi$ is continuous. Thus, $\phi$ is a homotopy from the identity to a constant map, so $X$ is contractible.