I'm having trouble finding something to clarify this. It's been mentioned in the Difficulty Class section of the DMG (238) that there should be a 50/50 chance that an average person can succeed at a DC 10 challenge, implying you have to beat it. However, I'd always thought that there's a 50/50 chance for an average person to hit another average person, but the chance is really 55/45, since you only have to equal their AC.
This is answered on page 7 of the PHB:
3. Compare the total to a target number. If the total equals or exceeds the target number, the ability check, attack roll, or saving throw is a success. Otherwise, it’s a failure. [...] The target number for an ability check or a saving throw is called a Difficulty Class (DC).
And on page 174:
If the total equals or exceeds the DC, the ability check is a success — the creature overcomes the challenge at hand. Otherwise, it’s a failure...
As for opposed checks (called contests, also found on page 174 of the PHB), instead of rolling against a pre-set DC you're essentially rolling against a DC set by another creature's ability check. In this case you must roll higher than what the other creature rolled in order to succeed and a tie means neither creature wins or losses and the situation stays the same.
The die roll needs to be equal to or greater than the number indicated for success.
- Compare the total to a target number. If the total equals or exceeds the target number, the ability check, attack roll, or saving throw is a success.
(PHB p. 7; para 3 of section "the D20").