How to prove theoretically that Treatment Sum of Squares + Error Sum of Squares = Total Sum of Squares using the formula below? 
How to prove theoretically that Treatment Sum of Squares + Error Sum of Squares = Total Sum of Squares using the formula in the picture?
 A: I think we also have the relation $\sum_{i=1}^{p}n_i=N$ for the equation to be complete. Apparently, you have a data matrix with $p$ rows, where each row has data of length $n_i$. We can focus on LHS of your equation and open up the squares, call the entire sum as $S$:
$$S=\sum_{i=1}^p\sum_{j=1}^{n_i}\left[(\bar{Y_i}^2-2\bar{Y}\bar{Y_i} +\bar{Y}^2)+(Y_{ij}^2-2Y_{ij}\bar{Y_i}+\bar{Y_i}^2)\right]$$
Now, focusing on each term individually:
$$(1),(6)\ \ \ \sum_{i=1}^p\sum_{j=1}^{n_i}\bar{Y_i}^2=\sum_{i=1}^p{n_i\bar{Y_i}^2}, \ \ (3)\ \ \ \sum_{i=1}^p\sum_{j=1}^{n_i}{\bar{Y}^2=N\bar{Y}^2}$$
$$(2)\ \ \ -2\sum_{i=1}^p\sum_{j=1}^{n_i}{\bar{Y}\bar{Y_i}}=-2\bar{Y}\sum_{i=1}^p{n_i\bar{Y_i}}=-2N\bar{Y}^2 \ \ \ \text{since} \ \sum_{i=1}^p{n_i\bar{Y_i}}=\sum_{i=1}^p\sum_{j=1}^{n_i}{Y_{ij}}=N\bar{Y}$$
$$(5)\ \ \ -2\sum_{i=1}^p\sum_{j=1}^{n_i}{Y_{ij}\bar{Y_i}}=-2\sum_{i=1}^p\bar{Y_i}\sum_{j=1}^{n_i}Y_{ij}=-2\sum_{i=1}^{p}n_i\bar{Y_i}^2$$
4-th term is already in the form in the RHS. $(1)+(6)+(5)$ yields $0$. $(2)+(3)$ is $-N\bar{Y}^2$. So, the LHS becomes
$$S=\sum_{i=1}^{p}\sum_{j=1}^{n_i}{[Y_{ij}^2-\bar{Y}^2]}$$
Which is not exactly the equation on RHS, but this is the true one I guess. To convince myself, I thought about a data matrix with one row, i.e. $p=1$ and $2$ entries in it, i.e. $n_1=2$, $Y = [1, 1]$. Then, $\bar{Y}=\bar{Y_1}=1$. The LHS of your equation is $0$, the RHS is $1$. In the corrected version they're equal. 
