Is membership of x in an infinite set decidable? In order to prove a certain function to be partially computable, I need to show an $\mathbb S$-program that computes it. I could really use the predicate $X \in B$ in my program to draw my conclusion. To give you the idea of what I am dealing with here it is one of my problems:


Give an infinite set $B$ such that $\Phi(x,x)\uparrow$ for all $b \in
B$ and such that $$H(x) = \begin{cases}1 \text{ if }
\Phi(x,x)\downarrow \\ 0 \text{ if } x \in B \\ \uparrow \text{
otherwise}\end{cases}$$ show that $H(x)$ is partially computable.


I am wondering if membership for infinite set is decidable and therefore can be used to write $\text{IF } X \in B$ such program. Am I allowed?

Edit: the notation $\Phi(x,x)\uparrow$ means the function is undefined.
No, this is not allowed, in general, if we know nothing about the set $B$.

As Andrej Bauer explains in the comments: if the set $B$ is arbitrary and there are no guarantees about the set $B$ (as you state in the comments), then no, you cannot write "IF $X \in B$" in a program, as the predicate $X \in B$ might not be computable (depending upon the set $B$).

Re-reading your question, I see that you are allowed to choose a set $B$ of your choice (subject to some conditions).  If you're able to choose $B$ in a way that makes $B$ recursively enumerable, then $B$ is no longer completely arbitrary and you now have an additional condition on $B$ which makes this a straightforward homework (as Andrej Bauer also explains in the comments).