\documentclass[12pt]{amsart}
\usepackage{amsmath,amsthm,amsfonts,latexsym,amssymb,amscd,xcolor}
\pagestyle{headings}
\setlength{\textwidth}{468true pt}
\setlength{\headheight}{0true pt} % needed for 12pt documents
\setlength{\oddsidemargin}{0 truept}
\setlength{\evensidemargin}{0 truept}
\setlength{\textheight}{580true pt}
\newtheorem{thm}{Theorem} %[section]
\newtheorem{cor}[thm]{Corollary}
\newtheorem{lm}[thm]{Lemma}
\newtheorem{prp}[thm]{Proposition}
\newtheorem{clm}[thm]{Claim}
%

\begin{document}


\noindent
{\bf Solutions to HW 3.}

\bigskip
  
\begin{enumerate}
\item[1.]
  Explain why it is true that the function
  $F:A\to {\mathcal P}(A): a\mapsto\{a\}$ is injective.  
\end{enumerate}
  
  \bigskip
  
\color{blue}
If $F(a)=F(b)$, then $\{a\}=\{b\}$, according to the definition of $F$.
Now, by the Axiom of Extensionality, $a=b$. This establishes
that $F$ is injective. (We showed that $F(a)=F(b)$
implies $a=b$.)
\color{black}

\vfill
  
\begin{enumerate}
\item[2.]
  In this problem,
  $f: A\to B$ and $g: B\to C$ will be composable functions.
\end{enumerate}
  

\bigskip

\begin{enumerate}
\item[(a)]
  Show that if
  $g\circ f$ is injective, then
  $f$ is injective, while if $g\circ f$ is surjective,
  then $g$ is surjective.
  \bigskip
  
\color{blue}
Assume that $f(a_1)=f(a_2)$. Since $g$ is a function,
$g(f(a_1))=g(f(a_2))$. This may also be written as
$g\circ f(a_1)=g\circ f(a_2)$. By the injectivity of
$g\circ f$, we get that $a_1=a_2$.
Altogether, this shows that
$f(a_1)=f(a_2)$ implies $a_1=a_2$, so $f$ is injective.
\color{black}

\vfill

\item[(b)]
  Show that if $g\circ f$ is surjective,
  then $g$ is surjective.

  \bigskip
  
  \color{blue}
Assume that $g\circ f: A\to C$ is surjective.
It is our goal to prove that $g: B\to C$ is surjective.
To this end, choose $c\in C$ arbitrarily; our aim is to show that
there exists $b\in B$ such that $g(b)=c$.
Since $g\circ f: A\to C$ is surjective, there is some
$a\in A$ such that $c = g\circ f(a) = g(f(a))$.
If we take $b=f(a)$, then we obtain that $g(b)=g(f(a))=c$,
as desired.
\color{black}

\end{enumerate}
\vfill  


\begin{enumerate}
\item[3.]
  This is a continuation of Problem 2,
  so assume that $f\colon A\to B$ and $g\colon B\to C$
  are composable functions.
\end{enumerate}

\bigskip

\begin{enumerate}
\item[(a)]
Give an example where
$g\circ f$ is injective, but
$g$ is not injective.

\bigskip

\item[(b)]
Give an example where
$g\circ f$ is surjective but $f$ is not surjective.

\bigskip
  
\color{blue}
We give an example that works for both Part (a) and Part (b).

Let $A = \{0\} = C$ and let $B = \{0,1\}$.
Let $f: A\to B$ be defined so that $f(0)=0$,
and let $g: B\to C$ be defined so that
$g(0)=g(1)=0$. Then $g\circ f: A\to C$ is the identity
function, so it is both injective and surjective.
But $f$ is not surjective and $g$ is not injective.
\color{black}
\end{enumerate}
\vfill

\end{document}
