Why was a resistor and capacitor used in this IR receiver circuit
As the datasheet clearly says, the TSOP output is open collector.  This means it needs a passive pullup to go high.

However, the circuit you show is messed up in several ways.  Assuming whatever you find on the internet to be good coupled with not reading the datasheet leads to trouble.  Specifically, problems with this circuit are:

100 &Omega; is a really low value for the pullup.  The TSOP would have to sink 50 mA to bring that low.  That's so much that I would not assume the TSOP can do that unless the datasheet explicitly says so.  In any case, that much current is totally unnecessary.  10 k&Omega; would be a much better pullup value.

100&micro;F on the output line is excessive, and totally unnecessary.  The circuitry inside the TSOP already produces a clear digital output that does not bounce.  There is no point in filtering that output further.  Perhaps that cap was intended to be between power and ground, but that's not what the schematic shows.

There is no decoupling cap.  Again, read the TSOP datahseet.  If I remember right, this even specifies a minimum decoupling capacitance.  C1 may have been intended to be between power and ground, which would make a lot more sense than where it is shown.  Even if so, a 1 to 10 &micro;F ceramic would be more approriate than a 100 &micro;F electrolytic.



All in all, this circuit is a mess.  Delete it, don't trust anything else you find on that website, and move on.