\documentclass[11pt]{article}
\usepackage{fullpage}
\usepackage{amssymb,amsfonts,amsmath,amsthm} 
\usepackage[margin= 1in]{geometry}
\usepackage{url}

\usepackage{enumerate}
\usepackage{color}
\usepackage[pdftex]{graphicx}
\usepackage{lastpage}

\newtheorem{thm}{THEOREM}[]
\newtheorem{lem}[thm]{LEMMA}
\newtheorem{cor}[thm]{COROLLARY}
\newtheorem{prop}[thm]{PROPOSITION}
\newtheorem{as}[thm]{ASSUMPTION}
\newtheorem{conjecture}[thm]{Conjecture}
\newtheorem{claim}[thm]{CLAIM}
\theoremstyle{definition}
\newtheorem{defi}[]{DEFINITION}
\theoremstyle{definition}
\newtheorem{remark}[thm]{REMARK}
\newtheorem{fact}[thm]{Fact}
\newtheorem{ex}[thm]{Example}

\setlength{\parindent}{0cm}

\newcommand{\tab}{\hspace{3ex}}

\usepackage{titlesec}
\usepackage{sectsty}
\hyphenchar\font=-1

\sectionfont{  \normalsize	\sectionrule{0pt}{0pt}{-5pt}{0.05pt}
	}

\titleformat*{\section}{ \Large  \center}
\titleformat{\subsection}[runin]
               {\normalfont\bfseries }
               {}{0em}{}[.]
               
\titlespacing{\section}
               {\parindent}{0pt}{5pt}
\titlespacing{\subsection}
               {0pt}{2ex plus .1ex minus .2ex}{5pt} 
               
               
               \makeatletter
 \renewcommand{\@evenfoot}{%
   Page \thepage{} of \pageref{VeryLastPage} \hfil
        \copyright Katy Craig, 2025, Math CS117 %
 }
 \renewcommand{\@oddfoot}{\@evenfoot}
 \makeatother

\newcommand{\R}{\ensuremath{\mathbb{R}}}
               
\begin{document}

\begin{center}
{\huge  \sc  Math 117: Homework 7} \\
{\large  Due Friday, June 6th at 11:59pm}
\end{center}
Questions followed by * are to be turned in. Questions without * are extra practice. At least one extra practice question will appear on each exam.
 

    \section*{Question 1}
        Suppose $S\subseteq \mathbb{R}$ is a bounded set and $f$ is a bounded function on $S$. Define $M = \sup \{ f(s) : s \in S \}.$
\begin{enumerate}[(a)]
\item Use the definition of the supremum to prove that there exists a sequence $s_n$ of elements in $S$ so that $\lim_{n \to +\infty} f(s_n) = M$.
\item Now, use the result from part (a) to prove that  there exists a \emph{convergent} sequence $t_k $ of elements in $ S$ so that $\lim_{k \to +\infty} f(t_k) = M$.
 \end{enumerate}

\section*{Question 2*}
Consider the set $S = \left\{ \sqrt{5} r : r \in \mathbb{Q} \right\}$. You may assume that $\sqrt{5}$ is an irrational number.
\begin{enumerate}[(a)]
\item Prove that $S$ is dense in $\mathbb{R}$ by showing that, for all $a, b \in \mathbb{R}$ with $a< b$, there exists $s \in S$ satisfying $a< s<b$.  \item Let $f: \mathbb{R} \to \mathbb{R}$ be continuous. Show that if $f(s) = \pi$ for all $s \in S$, then $f(x) =\pi$ for all $x \in \mathbb{R}$. 
\item Let $f$ and $g$ be continuous real-values functions defined on $\mathbb{R}$ such that $f(s) = g(s)$ for each $s \in S$. Prove that $f(x) = g(x)$ for all $x \in \mathbb{R}$. (Hint: define a new function and apply part (b).)
\end{enumerate}

\emph{As a consequence, you see that if two continuous functions on $\mathbb{R}$ are equal on a dense subset of $\mathbb{R}$, they must actually be equal everywhere.}
 
\section*{Question 3*}
\begin{enumerate}[(a)]
\item Consider $S \subseteq \R$ bounded, and suppose $f:S \to \R$ is uniformly continuous. Prove that $f$ is bounded on $S$.
\item Does the conclusion of part (a) still hold if $f$ is merely continuous? Justify your answer with a proof or counterexample.
\end{enumerate}

\section*{Question 4*}
Fix $x_0, x_1 \in \R$ with $x_0 < x_1$. Prove that $f:(x_0, x_1) \to \R$ is continuous if and only if for all $a \in (x_0, x_1)$,
\[ \lim_{x \to a} f(x) = f(a).\]

\section*{Question 5}


Suppose $f_n$ is a sequence of uniformly continuous functions on $S \subseteq \R$, and suppose there exists $f: S \to \R$ so that $f_n \to f$ uniformly on $S$. Prove that $f$ is uniformly continuous on $S$.

 \newpage
{ \sc \huge Practice Final Exam }
 
 \section*{Question 1}
Given $S \subset \R$, a function $f: S \to \R$ is \emph{increasing} if, for all $x, y \in S$, 
\[ x \leq y \iff f(x) \leq f(y) . \]

Inspired by HW7 Q4, we define a function $f: \R \to \R$ to be \emph{right continuous} if, for all $a \in \R$,
\[\lim_{x \to a^+} f(x) = f(a) . \]
\begin{enumerate}[(a)]
\item Give an example of a function $f : \R \to \R$ that is right continuous but not continuous. Justify your example with a proof.
\item Suppose $f_n$ is a sequence of continuous, increasing functions. Suppose that, for each $x \in \R$, $f_n(x)$ is a decreasing sequence and $f_n$ converges pointwise to $f$. Prove that $f$ is right continuous.
\end{enumerate}
\emph{This problem shows that, while the pointwise limit of continuous functions is not generally continuous, as long as suitable monotonicity hypotheses hold, the limit will be right continuous.}
 
\section*{Question 2}
Suppose $f_n$ is a sequence of continuous functions on a set  $[a,b]$ and there exists $f: [a,b] \to \R$ so that $f_n \to f$ uniformly on $[a,b]$. Prove that, for any sequence $x_n \in [a,b]$ with $\lim_{n \to +\infty} x_n =x$, we have $\lim_{n \to +\infty} f_n(x_n) = f(x)$.
 
 \section*{Question 3 }
Determine whether the following statements are true or false. If they are true, prove them. If they are false, provide a counterexample and justify your counterexample.
\begin{enumerate}[(i)]
\item If $\limsup_{n \to+\infty} x_n \leq \liminf_{n \to +\infty} y_n$, then $x_n \geq y_n$ for at most finitely many $n$.
\item If $\limsup_{n \to+\infty} x_n < \liminf_{n \to +\infty} y_n$, then $x_n \geq y_n$ for at most finitely many $n$.
\end{enumerate}

 
 \section*{Question 4}
Parts a and b are not related
\begin{enumerate}[(a)]
\item Fix $a \in \mathbb{R}$ and consider the function
\[ g_a(x) = \begin{cases} \frac{1}{x} & \text{ for } x \neq 0,  \\ a & \text{ for } x = 0 .\end{cases} \]
Prove that $g_a$ is not continuous.
\item
  Suppose $f$ is a continuous function on $\mathbb{R}$ and $f(a) f(b) <0$ for some $a,b \in \mathbb{R}$. Prove there exists $x$ between $a$ and $b$ such that $f(x) = 0$. 
 \end{enumerate}
 
 \label{VeryLastPage}
\end{document}

