For Master, Diamond, Platinum, Gold, Silver, and Bronze leagues, you will not be demoted for inactivity. (Inactive players are demoted out of Grandmaster league.)
However, your league membership only lasts for a season. And, if you are inactive for a full season, then play in a later season, you are considered a "new player" for league purposes.
Edit: If you skip an entire season, your MMR will be reset.
MMR persists from one season to the next for each game type as long as
a Seasonal Placement Match was played for that season. If a Seasonal
Placement Match was not played last season, then MMR and uncertainty
are both reset to their default values and the system effectively
"forgets" about that player.