Checking the bound on an expectation inequality Let $X_1,X_2,\dots,X_n$ be independent random variables such that
  $\mathbf{E}(X_i)=0,\mathbf{E}(X_i^2)\leq 1$ for $1\le i\le n$ then
  show that $$\mathbf{E}\left(\max_{1\le i\le
&gt; n}(X_1+X_2+\dots+X_i)^2\right)\leq \dfrac{n(n+1)}{2}$$


Now what I did was, the maximum would be some $(X_1+X_2+\dots+X_j)^2$ so we need to compute $$\mathbf{E}((X_1+\dots+X_j)^2)=\sum\mathbf{E}(X_i)^2+\sum\mathbf{E}(X_kX_\ell)=\sum_{i=1}^{j}\mathbf{E}(X_i^2)\le j$$
because $\mathbf{E}(X_kX_\ell)=\mathbf{E}(X_k)\mathbf{E}(X_\ell)=0$ is due to independence. But then $$\mathbf{E}\left(\max_{1\le i\le n}(X_1+X_2+\dots+X_i)^2\right)\le \max_{1\le j\le n}j=n$$
Which reduces the bound considerably. So, I am a bit worried this proof is flawed, can someone check it? Thanks a lot.
Your attempt is complete because you proved that 
$$\max_{1\leqslant i\leqslant n}\mathbb E\left[\left(\sum_{j=1}^i X_j\right)^2 \right] \leqslant n,$$
but in general, for non-negative random variables $Y_i$, $\max_{1\leqslant i\leqslant n} \mathbb EY_i\lt \mathbb E\left[\max_{1\leqslant i\leqslant n} Y_i \right] $.

In this case, however, we can notice that 
$$\max_{1\leqslant i\leqslant n}\left(\sum_{j=1}^i X_j\right)^2\leqslant 
\sum_{i=1}^n\left(\sum_{j=1}^i X_j\right)^2,$$
then take the expectation and use the fact that the $X_j$'s are uncorrelated.
Your attempt is complete because you proved that 
$$\max_{1\leqslant i\leqslant n}\mathbb E\left[\left(\sum_{j=1}^i X_j\right)^2 \right] \leqslant n,$$
but in general, for non-negative random variables $Y_i$, $\max_{1\leqslant i\leqslant n} \mathbb EY_i\lt \mathbb E\left[\max_{1\leqslant i\leqslant n} Y_i \right] $.

In this case, however, we can notice that 
$$\max_{1\leqslant i\leqslant n}\left(\sum_{j=1}^i X_j\right)^2\leqslant 
\sum_{i=1}^n\left(\sum_{j=1}^i X_j\right)^2,$$
then take the expectation and use the fact that the $X_j$'s are uncorrelated.