Let $M$ be a metric space.
Let us define a relation $\sim$ on $M$ as follows: given $x, y \in M$, $x \sim y$ if and only if there is a connected set $A \subseteq M$ with $x, y \in A$. Let us also write \[ [x]_\sim = \set{y \in M \mid x \sim y}.\]
The equivalence classes $[x]_\sim \subseteq M$ are called the connected components of $M$; they are in a loose sense the "largest connected pieces" of $M$. Notice that \[M = \bigcup_{x \in M} [x]_\sim,\] that is, $M$ is the union of its connected components. Also, since $[x]_\sim = [y]_\sim$ whenever $x \sim y$, the connected components of $M$ are disjoint. Since every point of $M$ is in some connected component, it follows that a non-empty space $M$ is connected if and only if it has precisely one connected component.
To give a few examples, the connected components of $\Z$ are the sets $\set{k}$ for each $k \in \Z$, and the connected components of $\Q$ are the sets $\set{q}$ for each $q \in \Q$. The connected components of $[0, 1) \cup \set{4} \cup (6, 9)$ are $[0, 1)$, $\set4$, and $(6,9)$. The circle $\set{(x, y) \in \R^2 \mid x^2 + y^2 = 1}$ has one connected component, itself; the same is true of any connected set. The empty set has no connected components (since in our definition, the empty set is not connected; we defined it this way so that we could unambiguously list the connected components of a set).
Suppose $M$ is a metric space. If $x, y \in M$, a path (in $M$) from $x$ to $y$ is a continuous function $\gamma : [0, 1] \to M$ with $\gamma(0) = x$ and $\gamma(1) = y$.
Define a relation $\sim_p$ on $M$ by $x \sim_p y$ if and only if there is a path from $x$ to $y$ in $M$. As before, set \[ [x]_{\sim_p} = \set{y \in M | x \sim_p y}.\]
The equivalence classes $[x]_{\sim_p} \subseteq M$ are called path components of $M$. If $M$ has exactly one path component, it is called path connected. (Note that $\emptyset$ is not path connected: it has zero path components, not one.)
Suppose that $E \subseteq \R^n$ is open. Show that the path components of $E$ are open (in $\R^n$).
(If you find it useful, you may use without proof the fact that functions of the form \begin{align*}f : \R &\longrightarrow \R^n \\ t &\longmapsto \vec{a} + t\vec{b}\end{align*} are continuous, where $\vec{a}, \vec{b} \in \R^n$.)
It is not true that connected sets are path connected in general. For example, the set \[T = \set{(0, y) \mid -1 \leq y \leq 1} \cup \set{\paren{x, \sin\paren{\frac1x}} \mid x \gt 0} \subseteq \R^2\] can be shown to be connected but not path connected; it's path components are the two separate pieces in the presentation above.
Suppose that $E \subseteq M$ and $p$ is a limit point of $E$. Suppose further that $f, g, h : E \to \R$ are functions, and that for some $\delta \gt 0$ and all $x \in E$ with $0 \lt d(x, p) \lt \delta$ we have \[f(x) \leq g(x) \leq h(x).\] Finally, suppose that \[\lim_{x\to p} f(x) = L = \lim_{y \to p} h(y).\] Prove that \[\lim_{t\to p} g(t) = L.\]
Let \begin{align*}f : \R &\longrightarrow \R \\ x &\longmapsto \begin{cases}0 & \text{ if } x \in \Q \\ x^2 & \text{ otherwise}.\end{cases}\end{align*} Show that $f$ is differentiable at $0$, and find its derivative there. (Notice that $f$ is discontinuous everywhere except at $0$! (That is an exclaimation point, not a factorial; $f$ is discontinuous at $1$.))
Here are some further problems to think about out of interest. You do not need to attempt them, nor should you submit them with the assignment. They are coloured by approximate difficulty: easy/medium/hard.
Let $M$ be a metric space and $E \subseteq M$. Show that the following are equivalent:
Show that there are two points on opposite sides of the equator with the same temperature as each other.
What assumptions are needed to make this true? Are they physically reasonable?
Suppose that you climb a mountain one day, and descend it the next. Show that there must be some time when your elevation was the same on both days.
Suppose that $E \subseteq \R$ has the property and $p \in E' \cap (E^c)'$. Suppose further that $f, g : \R \to \R$. Define \begin{align*} \varphi : \R &\longrightarrow \R \\ t &\longmapsto \begin{cases} f(t) &\text{ if } t \in E \\ g(t) &\text{ if } t \in E^c.\end{cases} \end{align*} Prove that $\varphi$ is differentiable at $p$ if and only if $f$ and $g$ both are, $f'(p) = g'(p)$, and $f(p) = g(p)$.