How can a computer deal with real numbers
Sage is an open source computer algebra system. Let's see if it can handle your basic example:

sage: sqrt(3) * (4/sqrt(3) - sqrt(3))
1

What is happening under the hood? Sage is storing everything as a symbolic expression, which it is able to manipulate and simplify using some basic rules.
Here is another example:

sage: 1 + exp(pi*i)
0

So sage can also handle complex numbers.
Computers never handle real numbers, since real numbers cannot be represented exactly on a computer. Instead, they either handle approximate representations of real numbers (usually floating point numbers but sometimes fixed point numbers), or they represent real numbers symbolically, as in the example above. Sage can convert between the two representations (in one direction!), and it can handle floating point numbers of arbitrary accuracy. For example,

sage: RealField(100)(pi^2/6 - sum(1/n^2 for n in range(1,10001)))
0.000099995000166666666333333336072

This computes $\pi^2/6 - \sum_{n=1}^{10^4} 1/n^2$ to 100 bits of accuracy (in the mantissa).
Another approach worth mentioning is interval arithmetic, which is a way of computing expressions with a guaranteed level of accuracy, using provable error brackets. Interval arithmetic is used in computational geometry, together with exact representation of rational numbers.
In theoretical computer science there are several other notions of real computation, but they are mostly of theoretical interest. See the answers to this question.