I apologize if my question is a bit naive, but I don't have much experience in number theory and sometimes get very confused.
Suppose $K$ is a non-archimedean local field (essentially a completion of a number field at some prime ideal of its ring of integers) and $\mathcal{O}_K$ is its ring of integers, i.e., its valuation ring ($\mathcal{O}_K = \{ x \in K \mid |x| \leq 1 \}$).
It seems to follow immediately from the definition of $\mathcal{O}_K$ that it is a closed subgroup of the additive group of $K$. But then when one defines the adele ring, one takes the restricted product of completions of a number field $F$ with respect to open compact subgroups (definition of restricted product) of those completions, and these subgroups are the rings of integers.
Also, in his proof that a local field $K$ is locally compact and its valuation ring $\mathcal{O}_K$ is compact, Neukirch states that for every $a \in K$, the set $a + \mathcal{O}_K$ is open.
So my question is: what is the topological status of $\mathcal{O}_K$ in $K$? Is it open, closed or both? Why?