Determine whether $\lim_{x\to0}{f(x)}$ exists, If $f(x)$ is a real valued function and, $$f(x)=\begin{cases}1/2 & \text{if } x\in\mathbb{Q} \\ 0 & \text{if } x\notin\mathbb{Q} \\\end{cases}$$
Acccording to the limit definition, If the limit exists,
$$\forall\epsilon\;\exists\delta\; |x-0|<\delta \implies |f(x)-L|<\epsilon$$
At $x=0$, $f(x) = 1/2.$ But regarding the above function we cannot guarantee that for a given $\epsilon$, we can find a $\delta$ satisfying the above definition. So the limit doesn't exist. (I feel since no matter what $\delta$ we choose there will be $x\notin\mathbb{Q}$, So we cannot guarantee the above definition will be satisfied.)
I don't see how to show this rigourously. Please correct me and give me a more rigourous way of showing whether the limit exists or not.
You're almost there. Consider two cases: $L = 1/2$, and $L \neq 1/2$.
If $L = 1/2$, choose $\epsilon = 1/4$. Then there is no neighborhood $U$ of $0$ such that $f[U] \subseteq (L - \epsilon, L + \epsilon)$: For any $\delta > 0$, the neighborhood $(-\delta, \delta)$ of $0$ contains an irrational $r$, so $|f(r) - L| = |0 - 1/2| = 1/2 \nleq \epsilon$. For this $\epsilon$, there is no $\delta$ satisfying the continuity condition.
If $L \neq 1/2$, let $\epsilon = |L - 1/2|/2$, so that $1/2 \notin (L - \epsilon, L + \epsilon)$. Then there is no neighborhood $U$ of $0$ such that $f[U] \subseteq (L - \epsilon, L + \epsilon)$, because any such $U$ has rational members $q$, and $f(q) = 1/2$ is not in the $\epsilon$ "ball" around $L$.