Let $X$ be a connected topological space which admits a universal covering. Let $Y$ be the topological space obtained as following:we have an homeomorphism $f : X \to X$ , we take $X \times \left[0,1\right]$ and we identify $(x,0)$ with $(f(x),1)$.
I should prove that $\pi_1(Y)$ is a semidirect product of $\pi_1(X)$ and $\mathbb{Z}$.
I think I found a solution but the fact that does not convince me is that I did not use the universal covering hypothesis.
Let $$\pi: X \times \mathbb{R} \to Y$$ $$(x,t) \to (f^{-\left \lfloor{t}\right \rfloor}(x),\{t \}) .$$ This map is a covering map.
One can check that the automorphism group is $\mathbb{Z}$ and acts transitively on the fiber of this covering; actually, one can explicitly describe this group as the maps $$\alpha_n(x,t)=(f^n(x),t+n)$$ with $n$ an integer.
So, because of standard theory facts about normal covering one has $$\frac{\pi_1(Y)}{\pi_1(X)} \cong \mathbb{Z} .$$
Now, a reasoning of group theory should end the demonstration.
Where is the mistake and where should I have used that hypothesis?
Your idea is sound, but the map you wrote down is not a covering map (at least it's not obviously one to me).
The space you're talking about is the mapping torus, and we can cover it with something called the mapping telescope.
Let $Y_\mathbb{Z}=\sqcup (X\times[n,n+1])$, and let $\widehat{Y}$ be the quotient space of $Y_\mathbb{Z}$ identifying $(x,n+1)$ and $(f(x),n+1)$, where the former is a right endpoint, and the latter a left endpoint. We can further write $\widehat{Y_m}$ as the image of $\{(x,n)\mid |n|\le m\}$ in $\widehat{Y}$.
Now $\widehat{Y}$ is a covering space of your $Y$, with covering map $\rho([x,n])=[x,n\pmod{1}]$. The sheets of this covering look like $$ \rho^{-1}([x,t])=\{[f^m(x),t+m]\mid m\in\mathbb{Z}\}$$
Now the deck transformations act on $\widehat{Y}$ via $p_m([x,n])=[f^m(x),n+m]$. Since this action is transitive on fibers, $\rho_*\pi_1(\widehat{Y})$ is a normal subgroup of $\pi_1(Y)$, and we also have $\pi_1(Y)/\rho_*\pi_1(\widehat{Y})\cong\mathbb{Z}$, with $\mathbb{Z}$ corresponding to those deck transformations. Since $\mathbb{Z}$ is a free group, we actually have a split extension $$ \pi_1(Y)\cong\pi_1(\widehat{Y})\rtimes\mathbb{Z}$$
Finally, we have $\pi_1(\widehat{Y})\cong\pi_1(X)$. That follows by describing an explicit homotopy equivalence between $X$ and $\widehat{Y_m}$ [for any $m$], and then reasoning via compactness that any map $\alpha:S^1\rightarrow\widehat{Y}$ ends up in some $\widehat{Y_m}$. Note that we can actually describe the semidirect action as well, since we have the deck transformations above that generate the $\mathbb{Z}$ factor. Namely, for $[\alpha]\in\pi_1(X)$ and $m\in\mathbb{Z}$, the action is given by $$ [\alpha]^{(m)}=[f^m(\alpha)]$$