@tanguatlay,
'I have eaten two pieces of apples' is incorrect. You could say 'I have eaten two pieces of apple' which would mean you had one apple, cut it into pieces and ate two pieces. This is not the same as 'I have eaten two apples'.
'I have eaten two pieces of fruit' could mean any kind of fruit. You might have eaten two apples, or an apple and a pear, or a mango and a banana.