About Definition 4.5, Theorem 4.6, Theorem 4.8 in "Principles of Mathematical Analysis" by Walter Rudin. Definition 4.5  

Suppose $X$ and $Y$ are metric spaces, $E \subset X, p \in E$ and $f$ maps $E$ into $Y$. Then $f$ is said to be continuous at $p$ if for every $\varepsilon > 0$ there exists a $\delta >0$ such that $$d_Y(f(x),f(p)) < \varepsilon$$ for all points $x \in E$ for which $d_X(x,p) < \delta$. 

Theorem 4.6  

In the situation given in Definition 4.5, assume also that $p$ is a limit point of $E$. Then $f$ is continuous at $p$ if and only if $\lim_{x \to p} f(x) = f(p)$.  

Rudin didn't write Definition 4.5 as follows:  
Definition 4.5'  

Suppose $X$ and $Y$ are metric spaces, $p \in X$ and $f$ maps $X$ into $Y$. Then $f$ is said to be continuous at $p$ if for every $\varepsilon > 0$ there exists a $\delta >0$ such that $$d_Y(f(x),f(p)) < \varepsilon$$ for all points $x$ for which $d_X(x,p) < \delta$. 

And Rudin didn't write Theorem 4.6 as follows:  
Theorem 4.6'  

In the situation given in Definition 4.5', assume also that $p$ is a limit point of $X$. Then $f$ is continuous at $p$ if and only if $\lim_{x \to p} f(x) = f(p)$.  

And Rudin wrote Theorem 4.8 as follows:  
Theorem 4.8  

A mapping $f$ of a metric space $X$ into a metric space $Y$ is continuous on $X$ if and only if $f^{-1}(V)$ is open in $X$ for every open set $V$ in $Y$.  

Why?  
Why is $E$ necessary in Definition 4.5, Theorem 4.6, Theorem 4.7?
I think $E$ is redundant.  



(Rudin's related explanation in the later chapter) 
You are right here. He can simply discard the complement of $E$ in $X$, and view it as a function from $E$ to $Y$. As IEm points out, E is a metric space in its own right using the metric inherited from $X$.
