I know that the following formula holds
$$\mathsf E (\sum_{i=0}^n X_{i}) =\sum_{i=0}^n(\mathsf E( X_{i}))$$
where $X_{i}$ are the possible values of a random vector. I think this is true because of Fubini's theorem but correct me if I am wrong.
Well, it has not much to do with Fubini's theorem. Expectation is a Linear operation, often represented as an abstracted integration. (PS: the index of a vector is usually based from 1.)
$$\mathsf E(\sum_{i=1}^n X_k) ~{=~ \int_\Omega \sum_{i=1}^n X_i(\omega)~\mathsf P(\mathrm d \omega)\\ =~ \sum_{i=1}^n \int_\Omega X_i(\omega)~\mathsf P(\mathrm d \omega)\\ =~ \sum_{i=1}^n \mathsf E(X_i)}$$
My question is if the following formula is also true $\newcommand{\bar}[1]{\overline{#1}}$
$$\mathsf E (\sum_{i=0}^n(X_{i}-\bar X)^2) =\sum_{i=0}^n(\mathsf E( X_{i}-\bar X)^2)$$
where by $\bar X$ I mean the $\bar X=(\sum_{i=0}^n X_{i})/n$. Of course $(X_{i}-\bar X)^2$ isn't a linear equation so I don't know if that means anything.
Can you please explain me if both formulas are true and why?
I've added the bar over the $X$, but left the brackets where they were; which is where you've gone awry. $\mathsf E((X_i-\bar X)^2)$ is not the same thing as $\mathsf E(X_i-\bar X)^2$.
Indeed $(X_i-\bar X)^2$ is not a linear operation, it is a measure; the Expectation operator is what is linear.
$$\mathsf E\left(\sum_{i=1}^n(X_i-\bar X)^2\right) ~{=~\int_\Omega \sum_{i=1}^n(X_i(\omega)-\bar X)^2\,\mathsf P(\mathrm d\omega) \\=~ \sum_{i=1}^n \int_\Omega (X_i(\omega)-\bar X)^2\,\mathsf P(\mathrm d\omega)\\=~\sum_{i=1}^n \mathsf E\left(( X_i-\bar X)^2\right)}$$