I was wondering how does a pool split this computationally difficult task into smaller tasks while at the same time preventing any individual miner to claim the reward if he happens to be the one hitting the correct solution?
dbbit covered the latter part and we both alluded to the former. However, let me try to be a bit clearer:
The task of calculating the hash is not difficult (it is so easy miners do hundreds of millions, even billions, of these every second).
What the pool needs is proof that a participating miner is trying and how hard. It's not enough to simply look at hashes that actually produce a valid block, since these will be too few and far between. Instead, the pool sets a much lower difficulty and miners submit all hashes they produce that match this lower difficulty (i.e. the hash value can have fewer zeros).
From the number of contributed low-difficulty hashes, the pool has proof positive that the miner is trying to find a valid hash and a good estimate of how much work the miner is doing.
Depending on how one looks at it, the argument could be made that miners who don't find a hash that is valid for the high difficulty, don't actually contribute anything. None of the work they perform is used in any way.
However, that's the nature of mining pools. Instead of playing the lottery (solo-mining), miners share the rewards equally (well, according to workload) regardless of who finds the "solution".
To take an analogy, imagine a group of people searching a field for a missing diamond. You can either reward the person who finds the diamond, or you can reward everyone who participates in the search with a share of the diamond according to how hard they are looking (easier to quantify when it's a miner).