Use epoll_ctl with the fd you want to check with the op argument EPOLL_CTL_ADD. If the fd is already registered then registration will fail with errno assigned with EEXIST.
If registration succeeds, then it is part of the epoll set so delete it from the set right away using epoll_ctl with the op argument EPOLL_CTL_DEL so that the set remains unchanged.
If you can add some more context to your problem then maybe we can come up with a better method.