Are Hogwarts students obligated to play Quidditch? If someone wasn't interested in sports or didn't want to do it, it was fine, wasn't it?
Are they obligated to play in the actual Quidditch matches? No.
This much is clear. There are only four House teams, and only seven players per team, but even taking the worst JKR maths into account, there must be a lot more than twenty-eight students at Hogwarts at any one time.
Are they obligated to learn how to fly brooms? Yes.
Madam Hooch's broom-flying lessons seem to be mandatory at least for all first-year students. Of course broom-flying isn't necessarily related to Quidditch, but it's certainly a necessary skill, and these lessons might be used by the Quidditch teams for talent-spotting, as when Harry was recruited onto the Gryffindor team in HP and the Philosopher's Stone.
How much Quidditch-specific training is mandatory? We don't know, but probably not much.
Beyond the basic skill of learning how to fly a broom, we don't know how much mandatory Quidditch-related training students undergo at Hogwarts. Harry, of course, is inducted into the Gryffindor Quidditch team after his very first flying lesson, and since he's the main character of the series, we don't see how things are for normal students where Quidditch is concerned.
How do the school Quidditch teams find people to recruit? We get some insight into this in HP and the Half-Blood Prince when Harry runs "tryouts" for new team members. (Perhaps surprisingly, this also involves re-inducting people like Ron and Katie Bell who'd been on the team already, even though we never before heard about Harry himself doing tryouts in order to keep his position as Seeker.) There are a lot more candidates than team positions, so evidently there's no difficulty finding people to volunteer for the team.
And if most recruitment to the house teams (except in special cases like Harry's) is by students volunteering and being tested, there's no particular need for mandatory training. Those who are interested in playing will train themselves privately - as Ron did in HP and the Order of the Phoenix, sneaking around with his broom while Harry was doing detentions - and those who aren't don't have to do anything other than learn how to fly a broom.
There are lots of students who don't play.
It's only the people who try out and succeed who play. For example, Hermione doesn't play Quidditch.
As pointed out by @Gallifreyan in the comments, first years do have a (seemingly) mandatory lesson in broom-flying. However, there is no requirement to continue playing.
And even for those who want to play can't always - there are tryouts. For instance, take Ron in The Order of the Phoenix:
"I - well - well, okay, I'll tell you, but don't laugh, all right?" Ron said defensively, turning redder with every second. "I-I thought I'd try out for Gryffindor Keeper now I've got a decent broom. There. Go ahead. Laugh."
Harry Potter and the Order of the Phoenix, chapter 13
And @Edlothiad provided the movie tryouts in Harry Potter and the Half-Blood Prince:
Remember, there are only a few people on each Quidditch team: 1 Keeper, 1 Seeker, 2 Beaters, 3 Chasers = 7 people. 7x4 houses = 28 people in the whole school. So, it is impossible for everyone to be required to play.
Quidditch playing is entirely voluntary.
In his speech at the beginning of the Hogwarts year, Dumbledore says that students who wish to play Quidditch for their house team should notify their Heads of House.
“Those wishing to play for their house Quidditch teams should give their names to their Heads of House as usual.”
- Harry Potter and the Half-Blood Prince, Chapter 8 (Snape Victorious)
Since students wishing to play must make that desire known before they can try out, it logically follows that students not wishing to play are not also required to try out for Quidditch.