Which of the following sets is connected?
Space $X = \mathcal{C}[0,1]$ with its usual "sup-norm" topology $$S = \left\{f\in X \mid \int_0^1 f(t) \: dt \neq 0\right\}$$
The set $$K = \{f\in\mathcal{C}[0,1] \mid \int_0^{\frac{1}{2}} f(t) \: dt - \int_{\frac{1}{2}}^1 f(t) \: dt = 1\}$$
From my point of view, both are connected and path connected.
For the path connectedness, consider two functions $f$ and $g$ in $S$ or $K$. Let us take $K$; that is, $f$ and $g$ are in $K$. For $t\in[0,1]$, consider $\phi(t): x \mapsto (1-t)f(t) + tg(t)$. The map $t \mapsto \phi(t)$ is continuous path from $f$ to $g$ which bears entirely in $K$, and for all $t\in [0,1]$: $$\int_{0}^{1}\phi(u)\,\mathrm du = (1-t)\int_{0}^{1/2}f(u)\,\mathrm du + t\int_{1/2}^{1}g(u)\,\mathrm du = 0 \ldots$$
Hence both sets $S$ and $K$ satisfy the path convexity, and so both are connected.
Is my answer is correct or not?
$S$ is not path connected ! Let $f(x)=1$ and $g(x)=-2x$. Then $f,g \in S$, but
$$\int_0^1(\frac{1}{2}f(x)+\frac{1}{2}g(x)) dx =0.$$.
$K$ is path connected, but your proof is not correct. Let $f,g \in K$ , $t \in [0,1]$ and let $h:=(1-t)f+tg$.
Then show carefully that $h \in K$.