Let $E$ be the set of points $(x,y)\in\mathbb{R}^2$ such that $0\leq x\leq 1$ and either $y=0$ or $y=1/n$ for some positive integer $n$. What are the components of $E$? Are they all closed? Are they relatively open? Verify that $E$ is not locally connected.
For any point $a\in\mathbb{R}^2$ let $C(a)$ be the component containing $a$. Then $C(a)$ is the union of all connected subsets of $\mathbb{R}^2$ containing $a$. For any point $a$ on a segment $y=1/n$, $C(a)$ must be that segment itself, because that segment is connected, and is not connected to other segments. So this leaves the segment $y=0$ to form a component on its own.
These segments are clearly closed.
Each segment $y=1/n$ is relatively open, because for any point inside it, you can take a neighborhood that doesn't contain part of any other segment of $E$. However, $y=0$ is not open, because any neighborhood will intersect a line $y=1/n$.
Now for local connectedness: It means that any neighborhood of a point $a$ contains a connected neighborhood of $a$. Then given any point $a$ and neighborhood of radius $\epsilon$, can't we just take the line segment of length $\epsilon/2$ with $a$ as its midpoint, to be a connected neighborhood of $a$? Doesn't this show that $E$ is locally connected?