Prove that $X$ is Hausdorff if and only if $Y$ is Hausdorff and $A$ is a closed subset of $X$ 
Part 1: Let $X$ be a topological space and $A$ a subset of $X$ . On $X \times \{0, 1\}$ define the partition composed of the pairs $\{(a, 0),(a, 1)\}$ for $a \in A$, and of the singletons $\{(x, i)\} $if $x \in X \setminus A$ and $i \in \{0, 1\}$. Let $ R$ be the equivalence relation defined by this partition, let $Y$ be the quotient space $(X \times \{0, 1\}) /R$ and let $p : X \times \{0, 1\} \rightarrow Y$ be the quotient map.
(a) Prove that there exists a continuous map $ f : Y \rightarrow X$ such that $f \circ p(x, i) = x$ for every $ x \in X $ and $i \in \{0, 1\}$.
(b) Prove that $Y$ is Hausdorff if and only if $X$ is Hausdorff and $A$ is a closed subset of $X$.
Part 2: Consider the above construction for $X = [0, 1]$ and $A$ an arbitrary subset of $[0, 1]$.
Prove that $Y$ is compact. Prove that $K = p[X × \{0\}]$ and $L = p[X × \{1\}]$ are compact,
and that $K \cap L$ is homeomorphic to $A$.

part 1a) attempt: try to prove that $f\circ p $ is continuous. So I need to show that if a set is closed in $X$, then it's closed in $X\times\{0,1\}$, which I would imagine is endowed with the product topology, in which both $\{0\}$ and $\{1\}$ are open (and closed). Hence, any closed set in $X$ would be closed in $X\times\{0,1\}$. As $f\circ p$ and $p$ are both continuous, it follows that so if $f$.
part 1b) no idea what strategy to use. I think $f\circ p$ is a homemorphism, but I'm not sure how that'd help. Also can't see how $A$ being closed would help.
part 2) $[0,1]\times\{0,1\}$ looks like it should be compact, as it's the union of two closed and bounded intervals in $\mathbb{R}$. But what about when I form the quotient space? And what about the last part?
 A: When you define $f$ as in your comment (so for a class $c$ of the form $c = \{(x,i)\}$, where $x \notin A, i \in \{0,1\}$, define $f(c) = x$, and for a class $c$ of the form $c = \{(a,0),(a,1)\}$, where $ a \in A$, also define $f(c) = a$), we have that $f \circ p = \pi_1$, where $\pi_1 : X \times \{0,1\} \rightarrow X$ is the projection onto the first coordinate. 
The universal property of the quotient map then shows that $f$ is continuous, as $\pi_1$ is. Short proof: if $O \subseteq X$ is open, $(\pi_1)^{-1}[O]$ is open by continuity of $\pi_1$, but this equals $p^{-1}[f^{-1}[O]]$. The definition of the quotient topology then says that $f^{-1}[O]$ is open, so $f$ is continuous.
For part 2, use that $p$ is continuous and $X \times \{0,1\}$ is compact. Ditto for $K$ and $L$. The only classes of $Y$ that have both upper and lower points are those with first coordinate in $A$, so the homeomorphism should be obvious.
A: Answer to part 1b (attempt)
"$\Rightarrow$": consider the function $p:X\times \{0,1\} \rightarrow (X\times \{0,1\})/ R$, and suppose $X$ isn't Hausdorff. Take $(x_1,0)\neq (x_2,0)$ and there exist separated open sets $U,V$ containing $p(x_1,0)$ and $p(x_2,0)$ respectively. Then $p^{-1}(U),p^{-1}(V)$ are open in $X\times \{0,1\}$ by continuity of $p$, are separated and contain respectively $(x_1,0)$ and $(x_2,0)$, contadicting that $X$ is Hausdorff. 
Now, suppose $A$ isn't closed. Take a point $a$ on the boundary of $A$, and consider $(a,0),(a,1)$ in $X\times \{0,1\}$. $p(a,0)\neq  p(a,1)$. I will show these points cannot be separated. Intuitively, I need to use the fact that any open neighbourhood of $a$ contains a point $b\in A$, and that $p(b,0)=p(b,1)$, but I'm having difficulty articulating an argument.
"$\Leftarrow$": if $(x,i_x),(y,i_y)$ are distinct and separable in $X \times \{0,1\}$, then clearly so are $p(x,i_x)$ and $p(y,i_y)$ in $(X\times \{0,1\})/ R$. If $x\in X\backslash A$, then $(x,0)\neq(x,1)$. As $A$ is closed, $X\backslash A$ is open. Then just take the sets $X\backslash A\times\{0\}$ and $X\backslash A\times\{1\}$ as separating sets. 
