TITLE: Prob. 21, Sec. 17, in Munkres' TOPOLOGY, 2nd ed: Closure and complementation can result in at most 14 different sets
QUESTION [5 upvotes]: Here's Prob. 21 in Sec. 17 of the book Topology by James R. Munkres, 2nd edition:

Consider the collection of all subsets $A$ of the topological space $X$. The operations of closure $A \to \overline{A}$ and complementation $A \to X-A$ are functions from this collection to itself.
(a) Show that, starting with a given set $A$, one can form no more than $14$ distinct sets by applying these two operations successively.
(b) Find a subset $A$ of $\mathbb{R}$ (in its usual topology) for which the maximum of $14$ is obtained.

My effort:
Based on the feedback I've had from the valued Mathematics Stack Exchange community, I would like to ammend my effort as follows:
Let $\mathcal{P} (X)$ denote the power set (i.e. the collection of all the subsets ) of $X$, and let the functions $f \colon \mathcal{P} (X) \to \mathcal{P} (X) $, $g \colon \mathcal{P} (X) \to \mathcal{P} (X) $, and $i \colon \mathcal{P} (X) \to \mathcal{P} (X) $ be defined as follows:
$$f(A) \colon= \overline{A} \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (X),$$
$$g(A) \colon= X - A \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (X),$$
and
$$i(A) \colon= \mathrm{Int} (A) \ \ \ \mbox{ for all } \ \ \ A \in \mathcal{P} (X).$$
Then we have the following couple of results
$$f(f(A)) = f(A), \ \ \ i(i(A) ) = i(A), \ \ \ \mbox{ and } \ \ \ g(g(A)) = A \ \ \ \mbox{ for all } \ A \in \mathcal{P}(X).$$
Moreover, we also have the following two relations:
$$f(g(A)) = g(i(A)) \ \ \ \mbox{ and } \ \ \ g(f(A)) = i(g(A)) \ \ \ \mbox{ for all } \ A \in \mathcal{P} (X).$$
How do we show that
$$f(g(f(g(f(g(f(g(A)))))))) = f(g(f(g(A))))$$ and  $$g(f(g(f(g(f(g(f(A)))))))) = g(f(g(f(A))))$$
for all $A \in \mathcal{P} (X)?$.
Please also refer to this link.

REPLY [5 votes]: Note also that
$$iA\subseteq A\subseteq fA$$
and
$$A\subseteq B\implies fA\subseteq fB,\ iA\subseteq iB.$$
From $$fgA=giA,$$ it follows that $$gfgA=ggiA=iA$$ and $$fgfgA=fiA;$$ thus the equality $$fgfgfgfgA=fgfgA$$ can be rewritten in the form $$fifiA=fiA,$$ which I will now prove.
$\underline{fifiA\subseteq fi A}$: From $$ifiA\subseteq fiA$$ it follows that $$fifiA\subseteq ffiA=fiA.$$
$\underline{fiA\subseteq fifiA}$: From $$iA\subseteq fiA$$ it follows that $$iA=iiA\subseteq ifiA$$ and $$fiA\subseteq fifiA.$$
Substituting $gA$ for $A$ in the previous identity, we have $$fgfgfgfg(gA)=fgfg(gA),$$ i.e., $$fgfgfgfA=fgfA;$$ taking complements, $$gfgfgfgfA=gfgfA.$$