Martingale and Submartingale problem 
Let $T_{1},T_{2},\ldots$ be an iid sequence with distribution function $F$; fix a number $x$. Define $$X_{i}=\textbf{1}_{\{T_{i}\leq x\}}-F(x),\phantom{x} i=1,2,\ldots, $$ and 
$$M_{0}=0,$$
$$M_{n}=\sum_{i=1}^{n}X_{i}, \phantom{x} n\geq 1$$
a) Show that $\{M_{n},n\geq 0\}$ is a martingale and $\{M_{n}^{2},n\geq 0\}$ a submartingale.
b) Show that $\{Z_{n},n\geq 0\}$ defined by
$$Z_{n}=M_{n}^{2}-n\sigma^{2}, \phantom{x}n\geq 0,$$
  where $\sigma^{2}=F(x)(1-F(x)),$ is a martingale.

I have a number of questions about solving this problem. Most of the questions are related to the way $X_{i}$ is defined.
What I have so far, updated version using the tremendous help provided by Did:
a) According to my notes a stochastic process $\{M_{n},n\geq 1\}$ is said to be a martingale process if, for all $n$
$$(i) \phantom{x} \mathbb{E}\left[\left|M_{n}\right|\right] < \infty, \\
(ii) \phantom{x} \mathbb{E}\left[M_{n+1}|M_{1},\ldots,M_{n}\right] = M_{n}.$$
And it is a submartingale if 
$$(i) \phantom{x} \mathbb{E}\left[\left|M_{n}\right|\right] < \infty, \\
(ii) \phantom{x} \mathbb{E}\left[M_{n+1}|M_{1},\ldots,M_{n}\right] \geq M_{n}.$$
First we will proof that $\{M_{n},n\geq0\}$ is a martingale.
We know that $\left|X_{i}\right|\leq 1$, since $0\leq F(x)\leq 1$ and $\textbf{1}_{\{T_{i}\leq x\}}$ is an indicator function taking the value 1 when $T_{i}\leq x$ and taking the value 0 when $T_{i}> x$. So we have
$$\mathbb{E}\left[\left|M_{n}\right|\right]=\mathbb{E}\left[\left|\sum_{i=1}^{n} X_{i}\right|\right]\leq \mathbb{E}\left[\sum_{i=1}^{n}\left| X_{i}\right|\right] =\sum_{i=1}^{n}\mathbb{E}\left[\left| X_{i}\right|\right]\leq \sum_{i=1}^{n}1=n<\infty$$
Question 1: Is what I am doing here correct?
Now what remains to be shown is the martingale property. We have:
\begin{align*}
\mathbb{E}\left[M_{n+1}|M_{0},\ldots,M_{n}\right] &= \mathbb{E}\left[M_{n}+X_{n+1}|M_{0},\ldots,M_{n}\right] \\
 & =\mathbb{E}\left[M_{n}|M_{0},\ldots,M_{n}\right] +\mathbb{E}\left[X_{n+1}|M_{0},\ldots,M_{n}\right] \\
&= M_{n} + \mathbb{E}[X_{n+1}] \\
&= M_{n} + \mathbb{E}[\textbf{1}_{\{T_{n+1}\leq x\}}-F(x)] \\
&= M_{n} + \mathbb{E}[\textbf{1}_{\{T_{n+1}\leq x\}}]-F(x) \\
&= M_{n} + \mathbb{P}(T_{n+1}\leq x)-F(x) \\
&= M_{n} + F(x)-F(x) \\
&= M_{n}.
\end{align*}
Where in the 3rd step we made use of taken out what is known and independence.
Thus indeed $\{M_{n},n\geq 0\}$ is a martingale.
Question 2: Is this correct?
Now the submartingale case. Same as before we know $\left|X_{i}\right|\leq 1$. So we have
$$\mathbb{E}\left[\left|M_{n}^{2}\right|\right]=\mathbb{E}\left[\left|\left(\sum_{i=1}^{n} X_{i}\right)^{2}\right|\right]=\mathbb{E}\left[\left|\sum_{i=1}^{n} X_{i}\cdot\sum_{i=1}^{n} X_{i}\right|\right]\leq \mathbb{E}\left[\sum_{i=1}^{n}\left| X_{i}\right|\cdot\sum_{i=1}^{n}\left| X_{i}\right|\right] = \\ \sum_{i=1}^{n}\mathbb{E}\left[\left| X_{i}\right|\right] \cdot \sum_{i=1}^{n}\mathbb{E}\left[\left| X_{i}\right|\right] \leq \sum_{i=1}^{n} 1 \cdot \sum_{i=1}^{n} 1 = n^{2} < \infty.$$
Question 3: Is this correct? 
For the submartingale property we have:
\begin{align*}
\mathbb{E}\left[M_{n+1}^{2}|M_{0}^{2},\ldots,M_{n}^{2}\right] &=  \mathbb{E}\left[(M_{n}+X_{n+1})^{2}|M_{0}^{2},\ldots,M_{n}^{2}\right] \\
&= \mathbb{E}\left[M_{n}^{2}+2M_{n}X_{n+1}+X_{n+1}^{2}|M_{0},\ldots,M_{n}\right] \\
 & =\mathbb{E}\left[M_{n}^{2}|M_{0},\ldots,M_{n}\right] +\mathbb{E}\left[2M_{n}X_{n+1}|M_{0},\ldots,M_{n}\right] +\mathbb{E}\left[X_{n+1}^{2}|M_{0},\ldots,M_{n}\right] \\
&= M_{n}^{2}+2M_{n}  \mathbb{E}\left[X_{n+1}\right] +\mathbb{E}\left[X_{n+1}^{2}\right] \\
&= M_{n}^{2} +2M_{n}\cdot 0+ \mathbb{E}\left[\left(\textbf{1}_{\{T_{n+1\leq x}\}}-F(x)\right)^{2}\right] \\
&= M_{n}^{2} + (1-F(x))^{2}\mathbb{P}\left(T_{n+1}\leq x\right)+(-F(x))^{2}\mathbb{P}\left(T_{n+1}>x\right) \\
&= M_{n}^{2} + (1-F(x))^{2}F(x)+F(x)^{2}(1-F(x)) \\
&= M_{n}^{2} + (1-F(x))[(1-F(x))F(x)+F(x)^{2}] \\
&= M_{n}^{2} + (1-F(x))[F(x)-F(x)^{2}+F(x)^{2}] \\
&= M_{n}^{2} + F(x)(1-F(x)) \\
&\geq M_{n}^{2}.
\end{align*}
Thus indeed $\{M_{n}^{2},n\geq 0\}$ is a submartingale.
Question 4: Is it correct?
b) Now we have 
$$\mathbb{E}[ \left|Z_{n}\right|]=\mathbb{E}\left[\left|M_{n}^{2}-n\sigma^{2}\right|\right]\leq \mathbb{E}\left[\left|M_{n}^{2}\right|\right]+n\sigma^{2}<\infty,$$
since in part a) we have seen for the submartingale case that $\mathbb{E}\left[\left|M_{n}^{2}\right|\right]<\infty$, furthermore $x$ is a fixed number for function $\sigma^{2}$.
Question 5: Is this correct, what I have done here?
What is left to prove is the martingale property. First we note that
$$\mathbb{E}[Z_{n+1}|Z_{1},\ldots,Z_{n}]=\mathbb{E}[Z_{n+1}|Z_{1},\ldots,Z_{n},M_{1},\dots M_{n}].$$
We can write
\begin{align*}
Z_{n+1} &= (M_{n}+X_{n+1})^{2}-(n+1)\sigma^{2} \\  &= M_{n}^{2}-n\sigma^{2}+2M_{n}X_{n+1}+X_{n+1}^{2}-\sigma^{2} \\
 &= Z_{n}+2M_{n}X_{n+1}+X_{n+1}^{2}-\sigma^{2}.
\end{align*}
So we get
\begin{align*}
\mathbb{E}\left[Z_{n+1}|M_{1},\dots M_{n}\right] 
&=  \mathbb{E}\left[Z_{n}+2M_{n}X_{n+1}+X_{n+1}^{2}-\sigma^{2}|M_{1},\dots M_{n}\right] \\
&= Z_{n}+2M_{n}\mathbb{E}\left[X_{n+1}|M_{1},\dots M_{n}\right]+\mathbb{E}\left[X_{n+1}^{2}|M_{1},\dots M_{n}\right]-\sigma^{2} \\
&= Z_{n}+2M_{n}\mathbb{E}\left[X_{n+1}\right]+\mathbb{E}\left[X_{n+1}^{2}\right]-\sigma^{2} \\
&= Z_{n}+2M_{n}\cdot 0 + \sigma^{2}-\sigma^{2} \\
&= Z_{n}.
\end{align*}
Question 6: Is this correct?
 A: Question 1: $E[|\mathbf 1_{T_i\leqslant x}-F(x)|]=(1-F(x))P(T_i\leqslant x)+F(x)P(T_i\gt x)=2F(x)(1-F(x))$ since $F(x)=P(T_i\leqslant x)$ hence $\mathbf 1_{T_i\leqslant x}=1$ with probability $F(x)$ and $\mathbf 1_{T_i\leqslant x}=0$ with probability $1-F(x)$. Thus, the upper bound $1-F(x)$ does not hold but the upper bound $1$ does, and this is enough to conclude.
(Or, more directly, $|X_i|\leqslant1$ hence $|M_n|\leqslant n$ hence $E[|M_n|]$ is finite.)
Question 2: $E[\mathbf 1_{T_i\leqslant x}]=P(T_i\leqslant x)=F(x)$.
Question 3:  $E[|\mathbf 1_{T_i\leqslant x}-F(x)|^2]=(1-F(x))^2P(T_i\leqslant x)+F(x)^2P(T_i\gt x)=F(x)(1-F(x))$, similarly to question 1.
(More directly, $|X_i|\leqslant1$ hence $M_n^2\leqslant n^2$ hence $E[M_n^2]$ is finite.)
Question 4: to conclude, use the fact that $E[X_{n+1}M_n\mid M_k,k\leqslant n]=M_n\,E[X_{n+1}]$. This holds because one conditions on the sigma-algebra $\mathcal M_n=\sigma(M_k,k\leqslant n)$ and that $X_{n+1}$ is independent on $\mathcal M_n$ while $M_n$ is measurable with respect to $\mathcal M_n$.
Question 5: correct, or use the same uniform boundedness argument as before.
Question 6: use same argument as before and $E[X_{n+1}]=0$ and $E[X_{n+1}]=\sigma^2$.
