Suppose $H(X) \rightarrow Y$ is collision resistant. Is $H$ also one-way? If we have $H(X) \rightarrow Y$
and it is collision resistant.
Can we say that $H$ is also one-way? And if that is true can you give me an example?
No. Consider $H:X \to Y$ where $X = Y$ and the function $H(x) = x$. The function is collision resistant, but not one-way.