\documentclass[11pt,letterpaper]{article}
\usepackage{amsmath,amsfonts}
\setlength{\oddsidemargin}{0in}
\setlength{\evensidemargin}{0in}
\setlength{\textwidth}{6.5in}
\setlength{\topmargin}{-0.5in}
\setlength{\textheight}{8.9in}
\setlength{\parskip}{0.4em}
\parindent0mm
\def\Q{\mathbb{Q}}
\def\R{\mathbb{R}}
\def\Z{\mathbb{Z}}
\def\C{\mathbb{C}}
\begin{document}
\begin{center}
{\bf \Large Math 112 Homework 6 Solutions}\medskip
\end{center}

{\bf Problem 1.}

Let $p\in\bar{E}$: by an immediate corollary of Theorem 3.2, there exists 
a sequence $\{p_n\}$ of elements of $E$ such that $p_n\to p$ (if $p\in E$ 
we can take $p_n=p$; if $p$ is a limit point of $E$ we can use 
Theorem 3.2(d)). Since $f$ is continuous, we obtain that $f(p_n)\to f(p)$.
Since $p_n\in E$, $f(p_n)\in f(E)$; so $f(p)$ is the limit of a
sequence of elements of $f(E)$, and therefore $f(p)\in\overline{f(E)}$.
So $f(\bar{E})\subset\overline{f(E)}$.

An example where $f(\bar{E})\neq \overline{f(E)}$ is given e.g.\ by
$f:\R\to\R$ defined by $f(x)=\exp(x)$ and $E=\R$: We have
$f(\bar{E})=f(E)=(0,+\infty)$, while $\overline{f(E)}=[0,+\infty)$.
\medskip

{\bf Problem 2.}

Direct argument: let $p$ be a limit point of $Z(f)$: there exists a sequence
$\{p_n\}$ of elements of $Z(f)$ such that $p_n\to p$. Since $f$ is
continuous we have $f(p)=\lim f(p_n)$. However 
$p_n\in Z(f)$, so $f(p_n)=0$; therefore $f(p)=0$, i.e.\ $p\in Z(f)$.
So $Z(f)$ contains its limit points, i.e.\ it is closed.

Alternate method: by Problem 1, $f(\overline{Z(f)})\subset
\overline{f(Z(f))}$. However, by definition $f(p)=0$ $\forall p\in Z(f)$,
so $f(Z(f))\subset \{0\}$. In particular $f(\overline{Z(f)})\subset
\overline{\{0\}}=\{0\}$, i.e.\ $\forall p\in\overline{Z(f)}$ we have
$f(p)=0$ and therefore $p\in Z(f)$. So $Z(f)$ is closed.
\medskip

{\bf Problem 3.}

Recall that $E$ is dense in $X$ if and only if $\bar{E}=X$. Therefore,
by Problem 1 we have $f(X)=f(\bar{E})\subset \overline{f(E)}$. So
every point of $f(X)$ is either an element of $f(E)$ or a limit point of
$f(E)$, i.e.\ $f(E)$ is dense in $f(X)$.

Assume that $g(p)=f(p)$ $\forall p\in E$, and consider any point $p\in X$.
Since $p\in\bar{E}=X$ there exists a sequence $\{p_n\}$ of points of $E$
such that $p_n\to p$. Since $f$ and $g$ are continuous, we have $f(p)=\lim
f(p_n)$ and $g(p)=\lim g(p_n)$. However $p_n\in E$, so $f(p_n)=g(p_n)$;
by uniqueness of the limit of a sequence, we conclude that $f(p)=g(p)$.
\medskip

{\bf Problem 4.}

{\it Note: your solution is incomplete if it assumes e.g.\ that $E$ is
closed, or an interval (-2 points).}

Method 1: taking $\epsilon=1$ in the definition of uniform continuity,
there exists $\delta>0$ such that $|x-y|<\delta$ $\Rightarrow$
$|f(x)-f(y)|<1$. There exists a positive integer $q$ such that
$\frac{1}{q}<\delta$. Moreover, since $E$ is bounded there exists an integer
$N$ such that $E\subset (-N,N)$. For every integer $-Nq\le n<Nq$, let
$I_n=[\frac{n}{q},\frac{n+1}{q})$. If $I_n\cap E\neq\emptyset$, pick some
element $x_n\in I_n\cap E$, and let $a_n=|f(x_n)|+1$; then, given any
$y\in I_n\cap E$, we have $|x_n-y|<\frac{1}{q}<\delta$ and therefore
$|f(y)-f(x_n)|<1$, so $|f(y)|<|f(x_n)|+1=a_n$; if $I_n\cap E=\emptyset$, 
let $a_n=0$. Now, let $A=\sup \{a_n,\ -Nq\le n<Nq\}$: because $E\subset
\bigcup I_n$, given any $y\in E$, there exists $n$ such that
$y\in E\cap I_n$, and therefore $|f(y)|<a_n\le A$. Therefore $f(E)\subset
[-A,A]$ is bounded.

Method 2: let $\delta>0$ be the same as above. By contradiction, 
assume $f(E)$ is not bounded, and for every
positive integer $n$ let $p_n$ be a point of $E$ such that $|f(p_n)|>n$.
Since $E$ is bounded, by sequential compactness (Theorem 3.6) the sequence 
$\{p_n\}$ has a convergent subsequence $\{p_{n_k}\}$: letting $q_k=p_{n_k}$,
we have $q_k\to q$ for some $q\in\bar{E}$ (but not necessarily in $E$, so
$f(q)$ is not necessarily defined!) and $|f(q_k)|\to +\infty$. Since the 
sequence $\{q_k\}$ is convergent, it is
a Cauchy sequence; so there exists $N$ such that $\forall m,n\ge N$,
$|q_m-q_n|<\delta$. Let $A=|f(q_N)|+1$: since $|f(q_n)|\to +\infty$, there 
exists $n\ge N$ such that $|f(q_n)|>A$; in particular we have $|q_n-q_N|<
\delta$ and $|f(q_n)-f(q_N)|\ge |f(q_n)|-|f(q_N)|>1$, which contradicts
the definition of $\delta$.

If $E$ is not bounded, a counterexample is given by 
the function $f(x)=x$ which is uniformly continuous 
(take $\delta=\epsilon$ in the definition!) but not bounded.
\medskip

{\bf Problem 5.}

Define a function $g:I\to\R$ by $g(x)=x-f(x)$. We must prove that there 
exists $x\in [0,1]$ such that $f(x)=x$, i.e.\ such that $g(x)=0$.
Since $f$ is continuous, $g$ is also continuous. Moreover, $g(0)=-f(0)\le 0$
since $f(0)\in [0,1]$, and $g(1)=1-f(1)\ge 0$ since $f(1)\in [0,1]$. 
If $g(0)=0$ or $g(1)=0$, then we are done. Otherwise, we have $g(0)<0$ and
$g(1)>0$: therefore, by Theorem 4.23, there
exists $x\in (0,1)$ such that $g(x)=0$, i.e.\ $f(x)=x$.\medskip

{\bf Problem 6.}

Let $x\in\R$, and let $\{x_k\}$ be a sequence such that $x_k<x$ $\forall k$
and $x_k\to x$. We first show that $f(x_k)\to 0$.
Indeed, fix some $\epsilon>0$. There exists an integer $N$ such that
$\frac{1}{N}<\epsilon$. The only points of $\R$ where
$f$ takes values larger than $\frac{1}{N}$ are the rationals of the form
$\frac{m}{n}$, where $n\le N$. Let $S=\{\frac{m}{n}\in (x-1,x)\
\mathrm{s.t.}\ n\le N\}$: clearly $S$ is finite (there are only finitely
many choices for $n$, and for each of these there are finitely many possible
values of $m$). If $S$ is non-empty, let $y=\sup S$, else let $y=x-1$:
in both cases $y<x$, and by construction $f$ is bounded by $\frac{1}{N}$ at 
every point of $(y,x)$. Since $x_k\to x$ and $x_k<x$, there exists an 
integer $K$ such that, if $k\ge K$, then $x_k\in (y,x)$. Therefore, for
$k\ge K$ we have $0\le f(x_k)\le \frac{1}{N}<\epsilon$. So we have proved
that $f(x_k)\to 0$; since this is true for every sequence $\{x_k\}$ that
converges to $x$ from the left, we conclude that $f(x-)=0$.

A similar argument shows that $f(x+)=0$ $\forall x\in\R$. In other words,
we have $\lim_{t\to x} f(t)=0$ $\forall x\in\R$ (because the left-hand
and right-hand limits are both $0$; in fact it is possible to argue
directly from both sides at once). So, if $x$ is irrational, then we
have $\lim_{t\to x} f(t)=f(x)=0$, and therefore $f$ is continuous at $x$.
However, if $x=\frac{m}{n}$ is rational, then we have $f(x-)=f(x+)=0$
while $f(x)=\frac{1}{n}$, so $f$ has a simple discontinuity at $x$.

\end{document}
