Since connectedness componentsarealways both openandclose sets, you need an example in which "connected" is not the same as "path connected". Let A be the line segment, in , from (-1, 0) to (0,0) inclusive (so it is a closed set). Let B be the graph of y= sin(1/x) for . Let the topological space, X, be . A and B are "path components" of X but B is neither open nor closed.