Sheaf on $[0,1]$ with non-trivial cohomology Let $X = [0,1]$ and $F$ a sheaf of abelian group. I would like to know an example if it exists of a sheaf with non trivial first cohomology group.
If $F$ is locally constant I believe $H^1(X,F) = 0$. I also believe that for any sheaf $F$ on $X$, $H^k(X,F) = 0$ because $X$ has topological dimension $1$.
I know some example where sheaf cohomology is not homotopy invariant but this involves complicate methods and I would like if possible an elementary example (if it exists !)
 A: I think this example works; it is inspired by Ch. III, Exc. 2.1 in Hartshorne. I assume you mean the real interval $X = [0,1] \subset \mathbf{R}$ with the subspace topology (although the same proof works for any space $X$ with sheaf cohomology groups $H^0(X,\mathbf{Z}) = \mathbf{Z}$ and $H^1(X,\mathbf{Z}) = 0$).
Let $U = X \smallsetminus \{P,Q\}$, where $Y = \{P,Q\} \subset X$ are two points. Let $\mathbf{Z}$ be the constant sheaf on $X$. Denote
$$
  U \overset{j}{\hookrightarrow} X \overset{i}{\hookleftarrow} Y.
$$
Claim. $H^1(X,j_!(\mathbf{Z}\rvert_U)) \ne 0$.
Here, $j_!$ is the "extension by zero" functor, defined by
$$
  \Gamma(V,j_!\mathscr{F}) = \begin{cases}
    \Gamma(V,\mathscr{F}) & \text{if}\ V \subseteq U\\
    0 & \text{otherwise}
  \end{cases}
$$
Proof. First, there is a short exact sequence
$$
  0 \longrightarrow j_!(\mathbf{Z}\rvert_U) \longrightarrow \mathbf{Z} \longrightarrow i_*(\mathbf{Z}\rvert_Y) \longrightarrow 0.
$$
The long exact sequence on sheaf cohomology gives
$$
  \require{AMScd}
  \begin{CD}
    0 @>>> H^0(X,\mathbf{Z}) @>>> H^0(X,i_*(\mathbf{Z}\rvert_Y)) @>>> H^1(X,j_!(\mathbf{Z}\rvert_U)) @>>> H^1(X,\mathbf{Z})\\
    @. @| @| @| @|\\
    0 @>>> \mathbf{Z} @>>> \mathbf{Z}^2 @>>> H^1(X,j_!(\mathbf{Z}\rvert_U)) @>>> 0
  \end{CD}
$$
and so $H^1(X,j_!(\mathbf{Z}\rvert_U)) = \mathbf{Z} \ne 0$. $\blacksquare$
