I am trying to solve this exercise in Tao's analysis text.
Let $X$ be a subset of $\mathbf{R}$ be a continuous function. If $Y$ is a subset of $X$, show that the restriction $f \mid_Y : Y \to \mathbf{R}$ of $f$ to $Y$ is also a continuous function.
Here is my attempt at a proof.
Define the inclusion map $i: Y \to X$. Since $f$ is continuous by assumption, we have \begin{align*} \forall \epsilon > 0, \forall x_0 \in X, \exists \delta > 0, \forall x \in X, |x - x_0| < \delta \implies |f(x) - f(x_0)| < \epsilon. \end{align*} We first show that $i$ is continuous on its entire domain. Let $\epsilon > 0$. Pick an arbitrary $y_0 \in Y$. Then, by continuity of $f$, there exists $\delta$ such that for any $y \in Y$ (which is also in $X$), $|y - y_0| < \delta$ implies $|i(y) - i(y_0)| < \epsilon$. Thus, $i$ is continuous. Since the composition of continuous functions is continuous, $f \circ i$ is continuous. but $f \mid_Y = f \circ i$. Thus, the restriction is also continuous.
How does this look? I worry the proof could be lacking rigor, particularly in explaining why $i$ is continuous. All I am trying to say is that the same $\delta$ from continuity of $f$ should work for $i$ since "$\forall x \in X$" in the definition of continuity of $f$ certainly applies for a subset of $X$.