Solution (source code)

= Solution

Fix $x_0,y_0\in Z$. For a <continuous function> $f:Z\times Z\to\mathbb R$, every coordinate slice is <continuous>, because the maps $x\mapsto(x,y)$ and $y\mapsto(x_0,y)$ into the <product topology> are <continuous>. Their target $\mathbb R$ is <Hausdorff>. Part (a)(i) gives
$$
f(x,y)=f(x_0,y)=f(x_0,y_0)\qquad\text{for every }(x,y).
$$
Therefore \b[every such $f$ is a <constant function>]. This is the two-factor case of <continuous maps from products of cofinite spaces to Hausdorff spaces are constant>.

The second <coordinate projection> $\pi_2:Z\times\mathbb R\to\mathbb R$ is <continuous> and nonconstant. If a <homeomorphism> $H:Z\times Z\to Z\times\mathbb R$ existed, $\pi_2\circ H$ would be a nonconstant <continuous function>, contradicting the preceding conclusion. Hence
$$
\boxed{Z\times Z\not\cong Z\times\mathbb R.}
$$

For the half-plane, put $H_+=[0,\infty)$ as a <set>, so $K=\mathbb R\times H_+$. Its two ambient <topologies> give different answers:
$$
\begin{array}{c|cc}
\text{ambient space}&K\text{ closed?}&K\text{ compact?}\\\hline
Z\times Z&\text{no}&\text{yes}\\
Z\times\mathbb R&\text{yes}&\text{no}.
\end{array}
$$
In $Z\times Z$, if $K$ were <closed>, its <inverse image> under the <continuous map> $y\mapsto(x_0,y)$ would be <closed> in $Z$. That <inverse image> is $H_+$, which is neither a <finite set> nor all of $Z$, so it is not <closed> in the <cofinite topology>. Thus $K$ is \b[not <closed>].

To establish <compactness>, note that the <subspace topology> on any <subset> $A$ of a <topological space> with the <cofinite topology> is again cofinite. An <open cover> of a nonempty such $A$ has a nonempty member omitting at most finitely many points; finitely many more members cover those points. Hence <every subset of a cofinite space is compact>. In particular both $Z$ and $H_+$ with its cofinite <subspace topology> are <compact>. The <subspace topology> on $K\subseteq Z\times Z$ is their <product topology>, as one checks by tracing basis rectangles. The <product of two compact spaces> is <compact>, so $K$ is \b[<compact>] here.

For clarity, the finite-product <compactness> result needs no <Hausdorff condition>. Given an <open cover> of $A\times B$, cover each point by a basis rectangle lying in one covering member. For fixed $a\in A$, use <compactness> of $B$ to select finitely many rectangles whose second factors cover $B$, and intersect their first factors to get an <open neighbourhood> $U_a$ of $a$. Those finitely many original members cover $U_a\times B$. Finally finitely many $U_a$ cover $A$, producing a <finite subcover> of $A\times B$.

In $Z\times\mathbb R$, the second <coordinate projection> has
$$
K=\pi_2^{-1}([0,\infty)).
$$
Since the ray is <closed> in the usual <real line>, $K$ is \b[<closed>]. It is \b[not <compact>]: its <image> under a <continuous map> under $\pi_2$ is $[0,\infty)$, which is not <compact>. For an explicit obstruction, the <open intervals> $(-1,n)$, $n\geq1$, cover this ray but have no <finite subcover>.

Finally consider the diagonal $W$ in $Z\times\mathbb R$. Define
$$
\varphi:\mathbb R\longrightarrow W,\qquad \varphi(t)=(t,t).
$$
This is a <bijection>. The identity <function> from the usual <real line> to $Z$ is <continuous>: each nonempty cofinite <open set> is the <complement> of a <finite set>, and <finite sets> are <closed> in the usual <real line>. Both coordinates of $\varphi$ are therefore <continuous>, so $\varphi$ is <continuous> for the <product topology> and the <subspace topology> of $W$. Its inverse is the restricted second <coordinate projection>, which is <continuous>. Therefore
$$
\boxed{W\cong\mathbb R,\qquad W\not\cong Z.}
$$
For the second conclusion, $Z$ is <compact> whereas $W\cong\mathbb R$ is not <compact>; <homeomorphisms> preserve <compactness>. The <diagonal in a product with cofinite and Euclidean topologies> thus inherits the usual <topology>, despite one cofinite factor.