There are a couple different ways to approach this, but either way is likely going to require some JavaScript.
First Approach
One way to approach this is to preload the maximum number of messages you'd want to page through in the component. You'd use the rest FreeMarker Context Object and set your page_size to be that maximum. Then you could use the freemarker "chunk" built-in to get the posts a certain number at a time. You'd just set the chunk size to however many you want to show on each "page". Then with a combination of JavaScript/CSS you can hide/show the appropriate page as desired.
Pros: Easier than the next approach, minimal JavaScript coding required
Cons: Less efficient, less flexible since you can only have a fixed number of messages to page through.
Second Approach
Alternately, you can use AJAX to make calls to the REST API dynamically, and then update your component with the results you get back from the REST API. You would just pass through your page_size and page parameters to the REST API call. Freemarker isn't going to help you much in this case, it will be mostly JavaScript required.
Pros: More efficient, can page through the entire result set
Cons: More advanced coding required JavaScript
If you're just wanting a fixed number of pages, I'd suggest the first approach. If you want to be able to page through everything available, I'd suggest the second approach. Let me know if any of this doesn't make sense or is unclear.