Describe units and maximal ideals in this ring 
If $p$ is a fixed prime integer, let $R$ be the set of all rational numbers that can be written in a form $\frac{a}{b}$ with $b$ not divisible by $p$. I need to describe all the units in $R$ and all maximal ideals in $R$.

$\mathbb{Z} \subset R$, because $n=\frac{n}{1}$ for every integer $n$. It also seems to me that $R$ is a PID, since the addition and multiplication operations are just usual addition and multiplication of rational numbers.
So if $\frac{a}{b} \in R$ and $p \nmid a$, then $\frac{a}{b}$ is a unit in $R$ since $\frac{a}{b} \cdot \frac{b}{a}=1_R$. Am I missing anything?
But how about maximal ideals in $R$?

If an element $\frac{a}{b}\in R$, with $p\nmid b$, is invertible, then there exists $\frac{c}{d}\in R$, with $p\nmid d$, such that $\frac{a}{b}\frac{c}{d}=1$; this means $ac=bd$. Since $p\nmid bd$, it follows that $p\nmid a$. Conversely, if $p\nmid a$ and $p\nmid b$, then $\frac{b}{a}\in R$.
Now we know the noninvertible elements: they are of the form $\frac{pa}{b}$ (with $p\nmid b$) and it's clear that the sum of noninvertible elements is again noninvertible. Therefore the noninvertible elements form an ideal.
In general, every noninvertible element belongs to (at least) a maximal ideal, because it generates a proper ideal; invertible elements, on the other hand, belong to no maximal ideal. So this ring $R$ has exactly one maximal ideal.
Since every noninvertible element is of the form $\frac{p}{1}x$ (for some $x\in R$), we can conclude that the unique maximal ideal is principal.
It's not difficult to extend the argument to show that an ideal $I$ of $R$ ($I\ne\{0\})$ is of the form $I=\frac{p^n}{1}R$, where $n$ is the least exponent such that $\frac{p^n}{1}\in I$.
Of course the argument using localizations is more general, but in this case a “proof by hand” is possible.
