What is an example of a compact Hausdorff space $X$ and a contractible subspace $A\subset X$ such that $H^2(X)\ncong H^2(X/A)$?
Note that $A\subset X$ must not be a cofibration. I was thinking that $X=[0,1]^2$ and $A$ the comb space might work but I am not sure.
Let $X=S^2$ and let $A$ be the complement of a point in $X$. Then $X/A$ has only two points, and is in fact contractible. So $H^2(X)\cong\mathbb{Z}$ but $H^2(X/A)$ is trivial.
Here's an example for which $A$ is closed. Start with a sphere $S^2\subset\mathbb{R}^3$, and then replace a neighborhood of a point by circular waves that oscillate faster and faster as you get near the point, accumulating at an entire line segment (like a 2-dimensional version of the topologist's sine curve). Let $A$ be the line segment where the waves accumulate and let $X$ be the union of the modified sphere and $A$. There is no path in $X$ from a point of $A$ to a point of the sphere, so $X$ is weak homotopy equivalent to the disjoint union of the punctured sphere and $A$; in particular, $H^2(X)$ is trivial. But $X/A$ is an ordinary sphere, so $H^2(X/A)\cong \mathbb{Z}$.