For a function Y : X→X , if Y is injective, then Y∘Y∘Y is injective.
My attempt: Using contrapositive, if Y is not injective. then Y ∘ Y is not injective, the there exist x, x' ∈ X with x ≠ x' but y(x) = y(x'). Then applying function y again both sides yields: y(y(x)) = y(y(x')). similarly for Y ∘ Y ∘ Y that is y(y(y(x))) = y(y(y(x'))). Thus, there exist x, x' ∈ X with x ≠ x' with (Y ∘ Y ∘ Y)(x) = (Y ∘ Y ∘ Y)(x'), is not injective.
Can someone correct me if I am wrong? or maybe is there a better approach to prove Y∘Y∘Y is injective?
You can also prove it directly. For simplicity let $Y^k$ be $Y$ nested $k$ times. We'll use the fact that function composition is associative. Suppose $Y^3(x)=Y^3(y)$ for $x,y\in X$. We can also write this as $Y(Y^2(x))=Y(Y^2(y))$. By injectivity of $Y$, it follows that $Y^2(x)=Y^2(y)$. In other words, $Y(Y(x))=Y(Y(y))$. Again by injectivity $Y$, this implies $Y(x)=Y(y)$. Once again by injectivity, this implies $x=y$.
We've thus shown that if $Y^3(x)=Y^3(y)$, then $x=y$. This is the definition of $Y^3$ being injective.