Yes a number of times. Rapportive, Etacts and Xobni were all YC and competitors. YC has also funded a number of competing developer recruitment startups.
YC funded a startup (Double Robotics) that competed with a YC partner's co (Anybots). Just apply.