Sorry, but I thought I am very good in complex analysis, but then I saw this question which makes me question myself "Is closed path different from contours?"
Now I know the difference between them by the logic that contours have orientation.
This problem is from Chapter 9 of Complex Analysis by Ian Stewart and David Tall.
But still to be frank, I honestly dont know how to prove this, as I can see that there is no orientation mentioned of $\gamma$, this is not a contour.
But still I don't think so it is the correct way to prove it. I plotted the sketch and yes it is closed, but I feel there must be some analytical way to prove this is closed but not a contour?
Please let me know or solve it please?

It seems that a contour is defined as "made up of a finite number of smooth paths which have non-zero continuous derivatives". See p.91.
Your path is continuous (note that $\lim_{t \to 0} \gamma(t) = \lim_{t \to 1} \gamma(t) = 0$). However it is not differentiable at $t = 0, 1$ since $$\dfrac{t + it\sin(\pi/t)}{t-0} = 1 +i\sin(\pi/t)$$ does not have a limit as $t \to 0$.