Analysis on Manifolds 5. The Derivative

这一章开始进入多元微分板块,本节是导数(多元导数)概念,通过一元的导数等价条件(牛顿近似)引入多元导数定义,并介绍了方向导数和偏导数(单位向量的方向导数)。本节的多元导数是以矩阵形式定义的(可看成线性变换),导数定义可以满足:可导必可微、复合函数可导、所有方向导数存在等三个条件。这一节开始的论述就比较详细,几个例子较好地体现了多元微分和一元微分的差异之处。
Theorem 5.1说明可微推出所有方向导数存在,且给出方向导数计算方法。
Theorem 5.2说明可微推出连续。
Theorem 5.3说明值域为R的多维函数的导数计算方法,即如果函数可微,其导数是一个行向量,行向量的子项是偏导数。
Theorem 5.4将上一定理的结论推广到了一般的多维空间。

Exercises

Exercise 1. Let A\subset \mathbf{R}^m; let f:A\to\mathbf{R}^n. Show that if f'(\mathbf{a};\mathbf{u}) exists, then f'(\mathbf{a};c\mathbf{u}) exists and equals cf'(\mathbf{a};\mathbf{u}).

Solution: If f'(\mathbf{a},\mathbf{u}) exists, then we have

\displaystyle{f'(\mathbf{a},\mathbf{u})=\lim_{t\to 0}\frac{f(\mathbf{a}+t\mathbf{u})-f(\mathbf{a})}{t}}

thus to calculate f'(\mathbf{a};c\mathbf{u}), notice if t\to 0, then h:=ct\to 0, thus

\displaystyle{\begin{aligned}f'(\mathbf{a},c\mathbf{u})&=\lim_{t\to 0}\frac{f(\mathbf{a}+tc\mathbf{u})-f(\mathbf{a})}{t}=c\lim_{t\to 0}\frac{f(\mathbf{a}+tc\mathbf{u})-f(\mathbf{a})}{tc}\\&=c\lim_{h\to 0}\frac{f(\mathbf{a}+h\mathbf{u})-f(\mathbf{a})}{h}=c'f(\mathbf{a};\mathbf{u})\end{aligned}}

Exercise 2. Let f:\mathbf{R}^2\to\mathbf{R} be defined by setting f(\mathbf{0})=0 and

\displaystyle{f(x,y)=xy/(x^2+y^2)\quad\text{ if }\quad (x,y)\neq 0.}

( a ) For which vectors \mathbf{u}\neq\mathbf{0} does f'(\mathbf{0};\mathbf{u}) exist? Evaluate it when it exists.
( b ) Do D_1f and D_2f exist at \mathbf{0}?
( c ) Is f differentiable at \mathbf{0}?
( d ) Is f continuous at \mathbf{0}?

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{t^2hk}{t^2h^2+t^2k^2}=\lim_{t\to 0}\frac{hk}{t(h^2+k^2)}}

this limit exists if h=0,k\neq 0 or h\neq 0,k=0, so f'(\mathbf{0};\mathbf{u}) exists when \mathbf{u} is along the x-asis or the y-axis, and when it exists, f'(\mathbf{0};\mathbf{u})=0.
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=0}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=0}

( c ) Since not all directional derivative exists, f is not differentiable at \mathbf{0}, otherwise contradicting Theorem 5.1.
( d ) f is not continuous at \mathbf{0}, let \mathbf{h}=[a,a]^T, then when a\to 0, \mathbf{h}\to 0, but f(a,a)=1/2\neq f(\mathbf{0}).

Exercise 3. Repeat Exercise 2 for the function f defined by setting f(\mathbf{0})=0 and

\displaystyle{f(x,y)=x^2y^2/(x^2y^2+(y-x)^2)\quad\text{ if }\quad (x,y)\neq 0.}

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{t^4hk}{t(t^4h^2k^2+t^2(k-h)^2)}=\lim_{t\to 0}\frac{thk}{t^2h^2h^2+(k-h)^2}}

this limit exists if k\neq h, so f'(\mathbf{0};\mathbf{u}) exists when \mathbf{u} is not along line y=x, and when it exists, f'(\mathbf{0};\mathbf{u})=1/(k-h)^2.
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=0}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(0,t)}{t}=0}

( c ) Since not all directional derivative exists, f is not differentiable at \mathbf{0}, otherwise contradicting Theorem 5.1.
( d ) f is not continuous at \mathbf{0}, let \mathbf{h}=[a,a]^T, then when a\to 0, \mathbf{h}\to 0, but f(a,a)=1\neq f(\mathbf{0}).

Exercise 4. Repeat Exercise 2 for the function f defined by setting f(\mathbf{0})=0 and

\displaystyle{f(x,y)=x^3/(x^2+y^2)\quad\text{ if }\quad (x,y)\neq 0.}

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{t^3h^3}{t(t^2h^2+t^2k^2)}=\lim_{t\to 0}\frac{h^3}{h^2+k^2}}

this limit exists if h=0,k\neq 0, so f'(\mathbf{0};\mathbf{u}) exists when \mathbf{u} is along the y-axis, and when it exists, f'(\mathbf{0};\mathbf{u})=0.
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=1}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(0,t)}{t}=0}

( c ) Since not all directional derivative exists, f is not differentiable at \mathbf{0}, otherwise contradicting Theorem 5.1.
( d ) f is continuous at \mathbf{0}, since for every open set V which contains f(\mathbf{0})=0, we can find a \epsilon>0 s.t. (-\epsilon,\epsilon)\subset V, and for any \mathbf{h}=[a,b]^T,|\mathbf{h}|<\epsilon, we have

\displaystyle{|f(\mathbf{h})|=\left|\frac{a^3}{a^2+b^2}\right|\leq |a|<|\mathbf{h}|<\epsilon}

Let U=B(\mathbf{0},\epsilon), then U is open and f(U)\subset V.

Exercise 5. Repeat Exercise 2 for the function

\displaystyle{f(x,y)=|x|+|y|.}

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{|th|+|tk|}{t}=\lim_{t\to 0}\frac{|t|}{t}(|h|+|k|)}

this limit does not exist if \mathbf{u}\neq 0, so f'(\mathbf{0};\mathbf{u}) does not exist.
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=\lim_{t\to 0}\frac{|t|}{t}}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(0,t)}{t}=\lim_{t\to 0}\frac{|t|}{t}}

thus D_1f(\mathbf{0}) and D_2f(\mathbf{0}) does not exist at \mathbf{0}.
( c ) Since not all directional derivative exists, f is not differentiable at \mathbf{0}, otherwise contradicting Theorem 5.1.
( d ) f is continuous at \mathbf{0}, since for every open set V which contains f(\mathbf{0})=0, we can find a \epsilon>0 s.t. (-\epsilon,\epsilon)\subset V, and for any \mathbf{h}=[a,b]^T,|\mathbf{h}|<\epsilon/2, we have

\displaystyle{0\leq f(\mathbf{h})=|a|+|b|<\epsilon\implies f(\mathbf{h})\in(-\epsilon,\epsilon)\implies f(\mathbf{h})\in V}

Let U=B(\mathbf{0},\epsilon/2), then U is open and f(U)\subset V.

Exercise 6. Repeat Exercise 2 for the function

\displaystyle{f(x,y)=|xy|^{1/2}.}

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{|thtk|^{1/2}}{t}=\lim_{t\to 0}\frac{|t|}{t}|hk|}

this limit exists if h=0,k\neq 0 or h\neq 0,k=0, so f'(\mathbf{0};\mathbf{u}) exists when \mathbf{u} is along the x-axis or the y-axis, and when it exists, f'(\mathbf{0};\mathbf{u})=0.
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=0}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(0,t)}{t}=0}

( c ) Since not all directional derivative exists, f is not differentiable at \mathbf{0}, otherwise contradicting Theorem 5.1.
( d ) f is continuous at \mathbf{0}, since for every open set V which contains f(\mathbf{0})=0, we can find a \epsilon>0 s.t. (-\epsilon,\epsilon)\subset V, and for any \mathbf{h}=[a,b]^T,|\mathbf{h}|<\epsilon, we have

\displaystyle{f(\mathbf{h})=|ab|^{1/2}<|\epsilon^2|^{1/2}=\epsilon\implies f(\mathbf{h})\in(-\epsilon,\epsilon)\implies f(\mathbf{h})\in V}

Let U=B(\mathbf{0},\epsilon/2), then U is open and f(U)\subset V.

Exercise 7. Repeat Exercise 2 for the function f defined by setting f(\mathbf{0})=0 and

\displaystyle{f(x,y)=x|y|/(x^2+y^2)^{1/2}\quad\text{ if }\quad (x,y)\neq 0.}

Solution:
( a ) Let \mathbf{u}=[h,k]^T, then

\displaystyle{\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{u})-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(th,tk)}{t}=\lim_{t\to 0}\frac{th|tk|}{t|t|(h^2+k^2)}=\frac{h|k|}{h^2+k^2}}

this limit exists as long as \mathbf{u}\neq 0, so f'(\mathbf{0};\mathbf{u}) exists and
\displaystyle{f'(\mathbf{0};\mathbf{u})=\frac{h|k|}{h^2+k^2}}
( b ) We have

\displaystyle{D_1f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_1)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(t,0)}{t}=0}
\displaystyle{D_2f(\mathbf{0})=\lim_{t\to 0}\frac{f(\mathbf{0}+t\mathbf{e}_2)-f(\mathbf{0})}{t}=\lim_{t\to 0}\frac{f(0,t)}{t}=0}

( c ) We have, for \mathbf{h}=(x,x)^T\to (0,0),x>0, that

\displaystyle{\frac{f(\mathbf{0}+\mathbf{h})-f(\mathbf{0})-[0,0]\cdot\mathbf{h}}{|\mathbf{h}|}=\frac{x|x|}{|x|\sqrt{x^2+x^2}}=\frac{x}{\sqrt{2}|x|}=\frac{1}{\sqrt{2}}\nrightarrow 0}

we see f is not differentiable at \mathbf{0}.
( d ) f is continuous at \mathbf{0}, since for every open set V which contains f(\mathbf{0})=0, we can find a \epsilon>0 s.t. (-\epsilon,\epsilon)\subset V, and for any \mathbf{h}=[a,b]^T,|\mathbf{h}|<\epsilon, we have

\displaystyle{|f(\mathbf{h})|=\left|\frac{a|b|}{\sqrt{a^2+b^2}}\right|\leq |a|<\epsilon\implies f(\mathbf{h})\in(-\epsilon,\epsilon)\implies f(\mathbf{h})\in V}

Let U=B(\mathbf{0},\epsilon/2), then U is open and f(U)\subset V.

Analysis on Manifolds 4. Compact Subspaces and Connected Subspaces of R^n

这一节回顾两个重要的概念:紧致集和联通集。由于本书主要讨论\mathbf R^n上的情况,因此紧致和有界闭集是等价的,但本节练习中也提到了非\mathbf R^n上的情况。
Theorem 4.1其实是很多书上紧致集的定义。
Theorem 4.2很简单,\mathbf R上闭区间是compact的。
Theorem 4.3说明在\mathbf R^n上compact可以推出closed和bounded,推论是最大最小值定理。
Theorem 4.5是极值定理,说明compact区间上的连续函数的值域也是compact的(连续函数保留compact特性)
Theorem 4.6\epsilon邻域定理,如果U是包含紧致集X的一个开集,那么可以找到一个X\epsilon邻域包含在U中。
Theorem 4.7是一致连续定理,compact集上的连续函数是一致连续的。
Theorem 4.9说明在\mathbf R^n上closed和bounded可以推出compact
Theorem 4.10说明\mathbf R上闭区间是联通的。
Theorem 4.11是介值定理。

Exercises

Exercise 1. Let \mathbf R_{+} denote the set of positive real numbers.
( a ) Show that the continuous function f:\mathbf{R_+}\to\mathbf{R} given by f(x)=1/(1+x) is bounded but has neither a maximum value nor a minimum value.
( b ) Show that the continuous function g:\mathbf{R_+}\to\mathbf{R} given by g(x)=\sin{(1/x)} is bounded but does not satisfy the condition of uniform continuity on \mathbf{R_+}.
Solution:
(a) x>0 means 1+x>1 and thus f(x)<1, also f(x)>0 is obvious, thus 00, choose k\in\mathbf{N}^+ such that 4k\delta>1, if we let x_1=1/2k\pi,x_2=1/(2k\pi+\pi/2), then

\displaystyle{|x_1-x_2|=\left|\frac{1}{2k\pi}-\frac{1}{2k\pi+\pi/2}\right|=\frac{\pi/2}{2k\pi(2k\pi+\pi/2)}=\frac{1}{4k(2k\pi+\pi/2)} <\frac{1}{4k}<\delta}

but |g(x_1)-g(x_2)|=|\sin(2k\pi)-\sin(2k\pi+\pi/2)|=1.

Exercise 2. Let X denote the subset (-1,1)\times 0 of \mathbf{R^2}, and let U be the open ball B(\mathbf{0};1) in \mathbf{R^2}, which contains X. Show there is no \epsilon>0 such that the \epsilon-neighborhood of X in \mathbf{R^n} is contained in U.
Solution: Given any \epsilon>0, the point \mathbf{a}=(1-\epsilon/2,0)\in X, and B(\mathbf{a},\epsilon) is a \epsilon-neighborhood of X, but for the point \mathbf{b}=(1+\epsilon/4,0), we have

\displaystyle{|\mathbf{b}-\mathbf{a}|=3\epsilon/4<\epsilon \implies b\in B(\mathbf{a},\epsilon),\quad |\mathbf{b}-\mathbf{0}|=1+\epsilon/4>1 \implies \mathbf{b}\notin B(\mathbf{0},1)=U}

thus B(\mathbf{a},\epsilon)\nsubseteq U.

Exercise 3. Let \mathbf{R}^{\infty} be the set of all “infinite-tuples” \mathbf{x}=(x_1,x_2,\dots) of real numbers that end in an infinite string of 0’s. Define an inner product on \mathbf{R}^{\infty} by the rule \langle x,y\rangle=\sum{x_iy_i}. (This is a funite sum, since all but finitely many terms vanish.) Let |\mathbf{x}-\mathbf{y}| be the corresponding metric on \mathbf{R}^{\infty}. Define

\displaystyle{\mathbf{e}_i=(0,\dots,0,1,0,\dots,0,\dots)}

where 1 appears in the i^{th} place. Then the \mathbf{e}_i form a basis for \mathbf{R}^{\infty}. Let X be the set of all the points \mathbf{e}_i. Show that X is closed, bounded and non-compact.
Solution: X contains only isolated points, thus is closed. Since |\mathbf{e}_i|=\sqrt{\langle \mathbf{e}_i,\mathbf{e}_i\rangle}=1,\forall i, X is bounded.
To see X is not compact, notice that |\mathbf{e}_i-\mathbf{e}_j|=\sqrt{2},\forall i\neq j, then B(\mathbf{e}_i,1)\cap X=\mathbf{e}_i,\forall i, the open sets {B(\mathbf{e}_i,1):i\in \mathbf{N}^+ } covers X, but no finite subcover of X exists.

Exercise 4.
( a ) Show that open balls and open cubes in \mathbf{R}^n are convex.
( b ) Show that (open and closed) rectangles in \mathbf{R}^n are convex.
Solution:
( a ) Let B(\mathbf{y},{\epsilon}) be an open ball in \mathbf{R}^n, C(\mathbf{y},{\epsilon}) be an open cube in \mathbf{R}^n. First for any \mathbf{a},\mathbf{b}\in B(\mathbf{y},{\epsilon}), there is the relation |\mathbf{a}-\mathbf{y}|<{\epsilon},|\mathbf{b}-\mathbf{y}|<{\epsilon}, thus if \mathbf{x}=\mathbf{a}+t(\mathbf{b}-\mathbf{a}),0\leq t\leq 1, then

\displaystyle{\begin{aligned}|\mathbf{x}-\mathbf{y}|&=|\mathbf{a}+t(\mathbf{b}-\mathbf{a})-\mathbf{y}|=|(1-t)(\mathbf{a}-\mathbf{y})+t(\mathbf{b}-\mathbf{y})|\\&\leq (1-t)|\mathbf{a}-\mathbf{y}|+t|\mathbf{b}-\mathbf{y}|<{\epsilon}\end{aligned}}

which means \mathbf{x}\in B(\mathbf{y},{\epsilon}), thus B(\mathbf{y},{\epsilon}) is convex.
Next for any a,b\in C(\mathbf{y},{\epsilon}), there is the relation |\mathbf{a}-\mathbf{y}|<{\epsilon},|\mathbf{b}-\mathbf{y}|<{\epsilon}, thus if \mathbf{x}=\mathbf{a}+t(\mathbf{b}-\mathbf{a}),0\leq t\leq 1, then

\displaystyle{\begin{aligned}|\mathbf{x}-\mathbf{y}|&=|\mathbf{a}+t(\mathbf{b}-\mathbf{a})-\mathbf{y}|=|(1-t)(\mathbf{a}-\mathbf{y})+t(\mathbf{b}-\mathbf{y})|\\&\leq (1-t)|\mathbf{a}-\mathbf{y}|+t|\mathbf{b}-\mathbf{y}|<{\epsilon}\end{aligned}}

which means \mathbf{x}\in C(\mathbf{y},{\epsilon}), thus C(\mathbf{y},{\epsilon}) is convex.
( b ) If Q is a rectangle in \mathbf{R}^n, we can write Q=[c_1,d_1 ]\times{\cdots}\times[c_n,d_n], for any a,b\in Q, we write a=(a_1,{\dots},a_n ),b=(b_1,{\dots},b_n), then there is the relation

\displaystyle{c_i\leq a_i,b_i\leq d_i,\quad 1\leq i\leq n}

thus if \mathbf{x}=\mathbf{a}+t(\mathbf{b}-\mathbf{a}),0\leq t\leq 1, then x_i=a_i+t(b_i-a_i )=(1-t) a_i+tb_i\in [c_i,d_i ], so \mathbf{x}\in Q.
If Q is an open rectangle in \mathbf{R}^n, the proof is very similar.

Analysis on Manifolds 3. Review of Topology in Rn

这一节回顾了在R^n中的基本拓扑知识,包括metric space,极限和连续,内点外点和边界点。这部分内容在大部分实分析中都有比较详尽的阐述。
Theorem 3.1是比较经典的开闭集交并结论:开集的有限交和无限并仍是开集,闭集的无限交合有限并仍是闭集。Theorem 3.2也比较经典,子空间的开/闭集是子空间和母空间开/闭集的交集。Theorem 3.3是闭包的概念以及闭集的判别条件。Theorem 3.4说明开闭集与选取的metric无关。
Theorem 3.5说明连续函数的限制仍是连续的,复合连续函数仍是连续函数。Theorem 3.6说明多维连续函数的每个分量函数必须是连续的,反之亦然,四则运算不影响连续性,投影函数连续。
Theorem 3.7说明连续性和极限的关系(在非isolated point上满足当x\to x_0时,f(x)\to f(x_0))。Theorem 3.8将上一定理的结果拓展到n维。

Exercises

Throughout, let X be a metric space with metric d.
Exercise 1. Show that U(x_0;\epsilon) is an open set.
Solution: For \forall x\in U(x_0;\epsilon ), we have d(x,x_0 )<\epsilon, thus \delta :=\epsilon -d(x,x_0 )>0, consider the set U(x,\delta), for any y\in U(x,\delta ), we can have d(y,x_0 )\leq d(y,x)+d(x,x_0 )<\delta +d(x,x_0 )=\epsilon, so y\in U(x_0;\epsilon) and U(x,\delta )\subset U(x_0;\epsilon ), which means U(x_0;\epsilon ) is an open set.

Exercise 2. Let Y\subset X. Give an example where A is open in Y but not open in X. Give an example where A is closed in Y but not closed in X.
Solution: Let X=(-1,2),Y=A=[0,1], then A is open in Y, but not open in X.
Let X=[0,1],Y=A=[0,1), then A is closed in Y, but not closed in X.

Exercise 3. Let A\subset X. Show that if C is a closed set of X and C contains A, then C contains \overline{A}.
Solution: Let x be any limit point of A, then every \epsilon-neighborhood of x intersects A with a point y\neq x, thus every \epsilon-neighborhood of x intersects C with a point y\neq x, so x is a limit point of C. Since C is closed, x\in C, and \overline{A}\subset C.

Exercise 4. ( a ) Show that if Q is a rectangle, then Q equals the closure of \text{Int} Q.
( b ) If D is a closed set, what is the relation in general between the set D and the closure of \text{Int }D?
( c ) If U is an open set, what is the relation in general between the set U and the interior of \overline{U}?
Solution:
( a ) Since \text{Int }Q\subseteq Q and Q is closed, by Exercise 3 we know \overline{\text{Int }Q}\subseteq Q, now for any \mathbf{q}\in Q, if \mathbf{q}\notin \text{Int }Q, then \mathbf{q}\in\text{Bd }Q, if we denote Q=[a_1,b_1 ]\times \dots \times [a_n,b_n ] and \mathbf{q}=(q_1,\dots ,q_n), then at least one q_i equals a_i or b_i, for \forall \epsilon >0, we choose x_i as follows:

\displaystyle{x_i=\begin{cases}a_i+\epsilon /n,\quad q_i=a_i\\b_i-\epsilon /n,\quad q_i=b_i\\q_i,\quad a_i<q_i<b_i \end{cases},\quad i=1,\dots ,n}

then there is at least one x_i\neq q_i, so \mathbf{x}=(x_1,\dots ,x_n )\neq \mathbf{q}, and |\mathbf{x}-\mathbf{q}|\leq \epsilon <\epsilon, as \mathbf{x}\in \text{Int }Q, we see \mathbf{q}\in \overline{\text{Int }Q} and Q\subseteq \overline{\text{Int }Q}.
( b ) We obviously have \text{Int }D\subseteq D, thus \overline{\text{Int }D}\subseteq D. We may not have the relation in the other direction, for if we define D={(0,0),(1,0)}\subseteq \mathbf{R}^2, then \text{Int }D=\emptyset.
( c ) In general, if x\in U, then x belongs to an open set that is contained in U, thus in \overline{U}, so x\in \overline{\text{Int }U}, which means U\subseteq \overline{\text{Int }U}. We may not have the relation in the other direction, for if we define U=A\cup B, where A=(0,1)\times (0,1),B=(-1,0)\times (0,1) be two open rectangles in \mathbf{R}^2, then \overline{U}=[-1,1]\times [0,1] and \overline{\text{Int }U}=(-1,1)\times (0,1).

Exercise 5. Let f:X\to Y. Show that f is continous if and only if for each x\in X there is a neighborhood U of x such that f|U is continuous.
Solution: If f is continuous, then f is continuous at each point x of X. If x\in X, then for any neighborhood U of x, f|U is continuous since U\subseteq X.
Conversely, if \forall x\in X, there exists a neighborhood U of x such that f|U is continuous, then x\in U means f is continuous at x, thus f is continuous on X.

Exercise 6. Let X=A\cup B, where A and B are subspaces of X. Let f:X\to Y; suppose that the restricted function

\displaystyle{f|A:A\to Y\quad\text{and}\quad f|B:B\to Y}

are continuous. Show that if both A and B are closed in X, then f is continuous.
Solution: Since X=A\cup B=(X\backslash A)\cup (A\cap B)\cup (X\backslash B), and the three sets are disjoint. Let \forall x\in X.
If x\in X\backslash A, then notice that A is closed means X\backslash A is open, and X\backslash A\subset B, since f|B is continuous, by Exercise 3.5 there is a neighborhood U of x which is open in B such that f|U is continuous, notice that we can assign an open set U' in X s.t. U=U'\cap B, and x\in U', so U_x:=U'\cap (X\backslash A) is still a neighborhood of x and belongs to B, we can conclude f|U_x is continuous.
If x\in X\backslash B, we can similarly find an open set U_x in X s.t. f|U_x is continuous.
If x\in A\cap B, then there is U_1 open in A, s.t. x\in U_1,f|U_1 is continuous, and U_2 open in B, s.t. x\in U_2,f|U_2 is continuous. Then we can find U_1',U_2' open in X, s.t. U_1=U_1'\cap A,U_2=U_2'\cap B, and x\in U_1',x\in U_2', let U_x:=U_1'\cap U_2', then U_x is open in X and contains x, thus a neighborhood of x in X. To prove f|U_x is continuous, notice U_x=U_x\cap X=U_x\cap (A\cup B)=(U_x\cap A)\cup (U_x\cap B), and U_x\cap A=U_1'\cap U_2'\cap A=U_1\cap U_2'\subseteq U_1, U_x\cap B=U_1'\cap U_2'\cap B=U_1'\cap U_2\subseteq U_2, so f is continuous on U_x\cap A and U_x\cap B, thus on U_x.
We proved for each x\in X there is a a neighborhood U of x s.t. f|U is continuous, by Exercise 3.5 again, f is continuous.

Exercise 7. Finding the limit of a composite function g\circ f is easy if both f and g are continuous; see Theorem 3.5. Otherwise it can be a bit tricky:
Let f:X\to Y and g:Y\to Z. Let x_0 be a limit point of X and let y_0 be a limit point of Y. See Figure 3.1.

Consider the following three conditions:
(i) f(x)\to y_0 as x\to x_0.
(ii) g(y)\to z_0 as y\to y_0.
(iii) g(f(x))\to z_0 as x\to x_0.
( a ) Give an example where (i) and (ii) hold, but (iii) does not.
( b ) Show that if (i) and (ii) hold and if g(y_0)=z_0, then (iii) holds.
Solution:
(a) let f(x)=1 on X=[0,1] and g(x)=\begin{cases}x,0\leq x<1\\0,x=1\end{cases} on Y=[0,1], then 1 is a limit point of X and Y. When x\to 1,f(x)\to 1, and when y\to 1,g(y)\to 1, but for g(f(x)), when x\to 1 on X, we have g(f(x))=g(1)=0, so g(f(x))\to 0.
(b) By Theorem 3.7, if g(y_0 )=z_0 and (ii) hold, then g is continuous at y_0, thus for an open set V of Z containing z_0, we have some open set W\subset Y s.t. y_0\in W,g(W)\subset V, since (i) is true, for this W we can find an open set U of X containing x_0 s.t. f(x)\in W whenever x\in U,x\neq x_0, then we have

\displaystyle{g(f(x))\subset V,x\in U,x\neq x_0}

this means (iii) holds.

Exercise 8. Let f:\mathbf R\to\mathbf R be defined by setting f(x)=\sin{x} if x is rational, and f(x)=0 otherwise. At what points is f continuous?
Solution: At points x=k\pi,k\in \mathbf{Z} will f be continuous.

Exercise 9. If we denote the general points of \mathbf R^2 by (x,y), determine \text{Int }A,\text{Ext }A and \text{Bd }A for the subset A of \mathbf R^2 specified by each of the following conditions:
( a ) x=0.
( b ) 0\leq x<1.
( c ) 0\leq x<1 and 0\leq y<1.
( d ) x is rational and y>0.
( e ) x and y are rational.
( f ) 0<x^2+y^2<1.
( g ) y<x^2.
( h ) y\leq x^2.

Solution:
( a ) \text{Int }A=\emptyset,\text{Ext }A=R^2-A,\text{Bd }A=A
( b ) \text{Int }A={(x,y):01},\text{Bd }A={(x,y):(x=0)\vee(x=1)}
( c ) \text{Int }A={(x,y):0<x<1,0<y<1}, \text{Ext }A=\mathbf{R}^2-{(x,y):0\leq x\leq 1,0\leq y\leq 1}, \text{Bd }A={(x,y):(x=0,0\leq y\leq 1)\vee(x=1,0\leq y\leq 1)\vee(y=0,0\leq x\leq 1)\vee(y=1,0\leq x\leq 1)}
( d ) \text{Int }A=\emptyset,\text{Ext }A={(x,y):y<0},\text{Bd }A={(x,y):y\geq 0}
( e ) \text{Int }A=\emptyset,\text{Ext }A=\emptyset,\text{Bd }A=\mathbf{R}^2
( f ) \text{Int }A=A,\text{Ext }A=\mathbf{R}^2-{(x,y):x^2+y^2\leq 1},\text{Bd }A={(x,y):x^2+y^2=1}\cup (0,0)
( g ) \text{Int }A=A,\text{Ext }A={(x,y):y>x^2 },\text{Bd }A={(x,y):y=x^2 }
( h ) \text{Int }A={(x,y):yx^2 },\text{Bd }A={(x,y):y=x^2 }.