# Proving that it is a closed map.

I have that X equals $[0,1]\cup[2,3]$ as a subspace of $\mathbb{R}$, and $Y=[0,2]$ as a subspace of $\mathbb{R}$ we look at every space with the subspace topology.

Then we have the function:

$p(x)=x, x \in[0,1]$

$p(x)=x-1, x \in [2,3]$

I need to show that if A is a closed space in X, then $p(A)$ is closed in Y.

I guess one way is showing that $p(A)^c$ is open in Y. So let $y \in p(A)^c$. I need to show that there is an open set U in $\mathbb{R}$ such that $y \in U\cap [0,2]\subset p(A)^c$.

Do you have any hints please?

Introductory remark: Since $X$ and $Y$ are closed subsets of $\mathbb R$ we don't need to distinguish between being a closed subset of $X$ or $Y$ and being a closed subset of $\mathbb R$.
Let $A$ be a closed subset of $X$. Then we can write $A$ as the disjoint union of $A_1:=A\cap [0,1]$ and $A_2:=A\cap [2,3]$. Note that $A_1$ and $A_2$ are closed.
Now we have $$p(A)= p(A_1) \cup p(A_2) = A_1 \cup (A_2-1).$$
Since $A_1$ and $A_2$ are closed (because $A_1$ and $A_2$ are closed and addition of a constant is a homeomorphism) we have that $p(A)$ is closed.