Given $[0,1]\times [0,1]$ with $(s,0)\sim (s,1)$, prove that $f$ is well-defined and continuous 
Let $\sim$ be the equivalence relation on $[0,1]\times [0,1]$ with $(s,0)\sim (s,1)$ (that is, two points $(s,t)$ and $(s',t')$ are equivalent if they are equal or if $s=s'$ and $\{t,t'\} = \{0,1\}).$ Let $X$ be the quotient space $([0,1]\times[0,1])/{\sim}$ and define $f\colon X\to X$ by
  $$
f([s,t]) = \begin{cases}
[s,t+\frac{1}{2}]&\text{if }t\le \frac{1}{2}\\
[s,t-\frac{1}{2}]&\text{if }t\ge \frac{1}{2}
\end{cases}
$$
Prove that $f$ is well-defined and continuous.

For showing that $f$ is well-defined, I believe the only point we are concerned about is $t=\frac{1}{2}$. But if $t=\frac{1}{2},$ we have
$[s,\frac{1}{2}]\mapsto [s,1]$ and $[s,\frac{1}{2}]\mapsto [s,0],$ but these are the same equivalence class. Thus $f$ is well-defined.
I'm not sure what to do to show that $f$ is continuous. I know that if $Y = [0,1]\times [0,1]$ and $q\colon Y\to X$ is the quotient map, then $f$ is continuous if and only if $q\circ f$ is continuous. But I don't know if that's any easier to show. What would be the best way to proceed?
 A: You need to do more to show that it is well-defined: you also need to show that if $(s,t)\sim(s',t')$, the definitions given of $f([s,t])$ and $f([s',t'])$ are equal.  The only nontrivial case of this is when $s=s'$ and $\{t,t'\}=\{0,1\}$, so you want to check that the definitions of $f([s,0])$ and $f([s,1])$ are the same for any $s$.
For continuity, there are some tricks you could use, but ultimately the simplest thing is probably to just directly use the definition of continuity.  That is, if $x\in X$ and $U\subseteq X$ is an open neighborhood of $f(x)$, show that there is an open neighborhood $V$ of $x$ contained in $f^{-1}(U)$.  You'll have to split into some cases based on whether $x$ and $f(x)$ have second coordinate $0$ or $1$.
The tricky part of doing this will be understanding what an open neighborhood in $X$ of a point like $[s,0]$ looks like.  For this, you want to just use the definition of the quotient topology: it looks like an open subset of $[0,1]\times[0,1]$ which contains $(s,0)$ such that it contains $(s',0)$ iff it contains $(s',1)$ for all $s'$.  So for instance, if you take a ball around $(s,0)$ together with another ball around $(s,1)$ of the same radius, that will give an open neighborhood of $[s,0]$.
(Some tricks you could use to avoid doing any messy work by invoking general theorems: you can write $X=A\cup B$ where $A=\{[s,t]:0\leq t\leq 1/2\}$ and $B=\{[s,t]:1/2\leq t\leq 1\}$.  Since $A$ and $B$ are closed in $X$, by the pasting lemma you just need to check that $f|_A$ and $f|_B$ are continuous.  Since $\sim$ is a closed equivalence relation on the compact Hausdorff space $[0,1]\times[0,1]$, $X$ is Hausdorff, and so $A$ and $B$ are Hausdorff.  The restriction of the quotient map to $[0,1]\times[0,1/2]\to A$ is a continuous bijection, and hence a homeomorphism since the domain is compact and the codomain is Hausdorff.  So to check whether $f|_A$ is continuous, you can consider $A$ to just have the usual topology on $[0,1]\times[0,1/2]$, and now the rest is easy.  Similar remarks apply to $B$.)
