If you’re trying to reason solely based off the fact that the cantor set is uncountable (this is my impression from your comments), then you cannot prove that it has cardinality $\mathfrak{c}$ with the standard axioms of mathematics. You need some form of the continuum hypothesis. As mentioned in Andre, if you can use the fact that the cantor set is closed, then you can prove it has carnality $\mathfrak{c}$ because every perfect subset of $\mathbb{R}$ has cardinality $\mathfrak{c}$
You can also do slightly more sophisticated proofs based on the algebraic representation of the cantor set. If you can consider the function that “reinterprets” a base 3 expression as a base 2 expression (sending $0$ to $0$ and $2$ to $1$). This function is a surjection into $\mathbb R$ and so the Cantor set is no smaller than $\mathbb R$. Since it’s also a subset, we get equality between their sizes.