How do I express a limit as a definite integral $\int_0^1 f(x) dx$ and then evaluate the limit $\lim_{n \to \infty} \frac{1}{n} ( \cos \frac{\pi}{2n} + \cos \frac{2 \pi}{2n} + ... + \cos \frac{k \pi}{2n} + .... + \cos \frac{(n-1) \pi}{2n} + \cos \frac{n\pi}{2n})$
What am I supposed to do with the limit as I have not encountered this type of problem relating definite integrals and limits before. Is this part of a discontinuous integrad?
I saw the answers and it states that
$\lim_{n \to \infty} \sum_1^n \frac{1}{n} \sin \frac{k\pi}{2n} = \lim_{n \to \infty} \sum_1^n \frac{1}{n} \cos (\frac{k}{n} \frac{\pi}{2})$
How did they even arrive to these steps using which method?