An elementary proof of $\pi_1(S^n) =1$ using this general theorem I was looking for an elementary proof of $ S^n$ being simply connected. My favourite is the one given by the user Olivier Bégassat in this post. 
Then i realized that what he did is a particular case of a theorem I'm trying to prove:

If $X$ is a topological space and $\{U_i\} $ is an open covering of $X $ such that each $U_i $ is simply connected, $U_i\cap U_j$ is path connected (for $ i\neq j$) 
  and $\bigcap U_i\neq \emptyset$, then $ \pi_1(X)=1$.

My aim was trying to prove it by emulating what Oliver Bégassat did in his answer: Taking a loop in $ X$ over some point  $c $ and then use the Lebesgue number on the open cover $f^{-1}(U_i) $ of $ I$ to get a partition of $ I$ in the sets $[\frac{k}{n},\frac{k+1}{n}] $ for some integer $ n$ and $0\leq k<n$ such that $f[\frac{k}{n},\frac{k+1}{n}]\subseteq U_{i_k} $ for some $ U_{i_k}$ in the cover. With this, Oliver could show that $ f$ was inside of a simply connected set (not necessarily one of the $ U_i$) which ended his proof.
The problem is what he did, was specifically for the context in he was, so it is to difficult to abstract it in my case. Any ideas to overcome this step?
Thank you all in advance
 A: Here's the trick.  We can assume our basepoint $c$ is in $\bigcap U_i$.  Now for each $k$ such that $0<k<n$, choose a path $\gamma_k$ from $c$ to $f(k/n)$ that is contained entirely in $U_{i_{k-1}}\cap U_{i_k}$.  Let $f_k$ denote the restriction of $f$ to $[k/n, (k+1)/n]$, so $f$ can be thought of as the concatenation of paths $f_0*f_1*\dots *f_{n-1}$.  Now for the clever part: we observe that $f$ is homotopic to $$f_0*(\gamma_1^{-1}*\gamma_1)*f_1*(\gamma_2^{-1}*\gamma_2)*\dots*(\gamma_{n-1}^{-1}*\gamma_{n-1})*f_{n-1}$$ since for each $k$ the path $\gamma_k^{-1}*\gamma_k$ is nullhomotopic.  Now we can regroup this big concatenation as $$(f_0*\gamma_1^{-1})*(\gamma_1*f_1*\gamma_2^{-1})*(\gamma_2*f_2*\gamma_3^{-1})*\dots*(\gamma_{n-1}*f_{n-1}).$$ Each of the parenthesized bits is now a loop based at $c$.  Moreover, $f_0*\gamma_1^{-1}$ is entirely contained in $U_{i_0}$, $\gamma_1*f_1*\gamma_2^{-1}$ is entirely contained in $U_{i_1}$, and so on.  So, since each $U_i$ is simply connected, all these loops are nullhomotopic, and we conclude that $f$ itself is nullhomotopic.
This argument is a special case of the proof of van Kampen's theorem, which generalizes your statement to determine $\pi_1(X)$ even if the sets $U_i$ are not simply connected.
