To avoid writing raw SQL and to ensure escaping/quoting in your subquery, use get_compiled_select() to render the subquery. I assume that you'll have more logic in your subquery, but for the asked question you can pass the table name into get_compiled_select() and SELECT * will be the default SELECT clause applied.
Once the subquery is safely rendered, you just turn off the escaping in its parent WHERE clause by passing false as the third parameter of where().
$this->db->where('EXISTS (' . $this->db->get_compiled_select('myTable') . ')', null, false);
This WHERE clause of your parent query will be rendered as:
WHERE EXISTS (SELECT * FROM `myTable`)