Well, the first set is neither open nor closed in the usual topology.This is because since comp {(1,5]} = $(-\infty,1] \cup (5,+\infty) $ , which is a union of a half-open interval with an open interval in the usual topology on R, which is neither open nor closed. So the complement of (1,5] is neither open nor closed and so (1,5] is neither as well.
By contrast, in the half-open topology-and I assume you mean the left half open topology here-the result here is rather interesting since the set is clopen i.e. both open and closed in R. This is It's easy to show the set of all half-open intervals is a base for a topology on R. But it's also clear that the complement of this is also open in the half open topology. This is because any open set in the usual topology is also open in the half open topology they can be expressed as a countably infinite union of half open intervals. I'll leave you to prove this yourself with the following hint: Consider an arbitrary open interval $(a,b) \subset$ R and the collection of half open intervals $ F_i\subseteq $(a,b) = { (a,$r_i$] | where $r_i \in Q$ and there exists $c\in R$ where a < $r_i$ < c $\leq b $ }. So this means the complement of this set is also open in the half open topology so (1,5] is both open and closed in this topology.
In the discrete topology,clearly any set is open,so (1,5] is open. In the indiscrete topology, only the entire space and the empty set are open,so (1,5] is closed. The finite complement topology is the collection of open sets defined by either the empty set or any set who's complement is finite. Therefore since the complement of (1,5] in R is not finite or empty, (1,5] is closed in this topology.
Now let's consider Q as a subset of R. Consider the usual topology on R and consider any intervals bounded by rationals, ie. ($r_1$,$r_2$). Since a rational number lies in between any 2 real numbers and an irrational number lies in between any 2 rationals, there is no open interval in Q that lies entirely in Q. Similarly, none of it's complements lie entirely in Q, either. So Q is niether open nor closed in the usual topology.
I don't have time to do the rest,sorry. But you can use the exact same reasoning to determine the answers to your other problems.
As for your last question, my first answer pretty much answered that-sets can be either both open and closed or neither in a given topology and we have to be really careful to ensure which it is.
Good luck!
Best Answer
Let $f:A\to B$ be a map and let $S$ be a subset of $B$, then the preimage of $S$ under $f$ is $$f^{-1}(S)=\{a\,|\,f(a)\in S\}.$$ For example if $A=\{1,2,3\}$, $B=\{a,b,c\}$ and $f$ is map defined by $f(1)=f(2)=a$, $f(3)=b$, then $$f^{-1}(\emptyset)=\emptyset,\\ f^{-1}(\{a\})=\{1,2\},\ f^{-1}(\{b\})=\{3\},\ f^{-1}(\{c\})=\emptyset,\\ f^{-1}(\{a,b\})=\{1,2,3\},\ f^{-1}(\{a,c\})=\{1,2\},\ f^{-1}(\{b,c\})=\{3\},\\ f^{-1}(\{a,b,c\})=\{1,2,3\}.$$